Basic Samba (Windows Filesharing) Configuration
From Genunix
First, write some options into the Samba configuration file. If no smb.conf file is present, or if it's very wrongly configured, the svcadm command will transition the Samba service to maintenance status when it detects something amiss. (You can check for 'problem services' with the command svcs -xv )
Become root first, if you aren't already:
# su -
As a good admin, you know better than to use a GUI text editor. Employ the trusty vi to edit your initial configuration. (You can also use SWAT, mentioned later in this tutorial, to set up a default config):
# vi /etc/sfw/smb.conf
Turn on the built-in Samba service with svcadm:
# svcadm enable samba
Make sure Samba is up and running properly:
# svcs -a | grep samba
Enable the SWAT web administration tool for Samba:
# svcadm enable swat
Make sure SWAT is up and running properly:
# svcs -a | grep swat
(If any of these services fails or transitions to maintenance status, you can check its log in /var/svc/log/[full_service_title].log - get the full service title from svcs -a | grep [service name])
Launch Firefox (the default bundled browser since around Solaris 10 10/06) to start using SWAT:
# firefox & (the & sends Firefox to the background so you don't have to open another terminal window)
You can now navigate to http://127.0.0.1:901 in the browser and configure Samba share paths and other options. Log in as root and don't forget to add new users to your Samba configuration under the Password heading (unless you need to tie Samba authentication to an NT or Active Directory domain or LDAP - a topic beyond the scope of this tutorial).
Create a share with the default User level access, but change the path from the default:
/tmp
to
/path/to/directory/of/choice
From a client machine, navigate to
\\[ipaddress of server]\[sharename] (PC)
or
smb://[ipaddress]/[sharename] (Mac), authenticate and enjoy!
(Astute readers will note that the web-based SWAT administration tool for Samba is not the best way to do serious Samba administration. However, SWAT is a good tool for learning the basics of Samba configuration. It's is also a very quick way to get file services up over SMB/CIFS.)
--Blake Irvin 18:55, 6 May 2007 (PDT)
