Linux / Unix Tips and Tricks

This blog contains Linux / Unix Tips and Tricks, collected during my work as a Unix System Administrator.
They are here for my own reference, but they might help you as well !

Solaris 10: Enable Samba for Windows File Sharing

len | 23 December, 2008 09:44

Today I got a question about users that want to access some FIX logfiles on a Solaris 10 server.
Of course you can give them (restricted) ssh access so they could access the files using WinSCP,
but I thought it would be easier to enable SAMBA for them so they could access the logfiles using their Windows Explorer. The good news is that Solaris 10 (9 as well) comes with SAMBA included in the OS, so you just need to enable it.

  1. Configure Samba by creating the file /etc/sfw/smb.conf
    Here's a minimal /etc/sfw/smb.conf which I used:

    [global]
          workgroup = WORKGROUP
          server string = Fix Server
          log file = /var/samba/log/log.%M
          security = user

    [logs]
          comment = FIX Log files
          path = /path/to/logs
          browseable = yes
          read only = yes
          guest ok = No


     
  2. Add a user called "readlog" on Unix

    # useradd -d /path/to/logs -s /bin/false readlog
     

  3. Add the new created user "readlog" to the SAMBA password database and configure a password:

    # /usr/sfw/bin/smbpasswd -a readlog

     
  4. Now we can start Samba for the first time !

    # /etc/init.d/samba start

  5. Test the Samba Server by starting a new Windows Explorer and type \\yourserver in the address bar.
    If everything is okay you'll get a password dialog where you can login with the username "readlog" and the password supplied at step 3.
 
Accessible and Valid XHTML 1.0 Strict and CSS
Powered by LifeType - Design by BalearWeb