Home Domain Tools How To Photo Albums Unix Stuff Support
SUPPORT & upport & Services
Hostname Change
Messaging Server 5.2
Mounting Dos Partitions
NTP
Samba
Sun Cluster 3.1
Contact us
Samba Solaris_7-9
Samba Howto
 
 

Installing Samba


1. Download the source code:


The source of Samba is available from http://samba.org. At the time of writing, the latest version is V2.0.6 and the source code is provided as a compressed tar archive in the file samba-2.0.6.tar.gz. Download the file to a temporary directory, such as /tmp.



2. Prepare the source code for compilation:


Make a directory at a convenient point in the file system to hold the source code and copy the source into this directory. For example:

# mkdir -p /opt/source/samba

# cd /opt/source/samba

# cp /tmp/samba-2.0.6.tar.gz .

Unzip and untar the source and then change to the directory created by tar:

# gunzip samba*

# tar xvf samba*

# cd samba-2.0.6

At this point, you may like to have a look at the README file for general information and at the file docs/textdocs/UNIX_INSTALL.txt for detailed installation instructions. If you're impatient, just follow the instructions here which should be enough to get you started..



3. Compile the source code and install Samba:


Configure the compilation process for your system:

# cd source

# ./configure

Compile the source code:

# make

Finally, install the compiled code:

# make install

This installs all the Samba files in directories under /usr/local/samba with the binaries in /usr/local/samba/bin and the manual pages in /usr/local/samba/man.



4. Modify the search path:


You now need to modify the man search path so that the 'man' command can find Samba's manual page. If you're running the CDE windowing system, this is done by editing the file /.dtprofile and adding the following lines (if they aren't already there) to the end of this file:

MANPATH=$MANPATH:/usr/man/:/usr/local/man:/usr/local/samba/man

It's advisable to log out and log in again at this point to activate this change. Make sure that the system can find the Samba manual page:

# man samba



5. Create the Samba lock directory:


At this point, create the lock directory used by Samba:

# mkdir /usr/local/samba/var/locks



6. Create a share directory:


It's useful to create a directory on the Solaris system that is fully shareable on the local network so that Windows systems can read files from the Solaris system and write files to it. To do this:

mkdir /share

chmod 777 /share

chmod +t /share

chown sys /share

chgrp sys share



7. Configure Samba:


Samba is controlled by means of the configuration file /usr/local/samba/lib/smb.conf

Create a basic configuration file containing the following lines:

# Global parameters

workgroup = HOME

security = Share

hosts allow = localhost, local-machine-name, 192.168.1.

hosts deny = All

[root]

path = /

comment = Solaris root

guest ok = Yes

read only = Yes

[share]

path = /share

comment = Solaris share

guest ok = Yes

read only = No


Note that "# Global parameters", "[root]" and "[share]" should be positioned at the start of their lines and all other lines should be prefixed with a tab character.

In this file, replace HOME with the name of your Windows workgroup or domain. On a Windows 95 or 98 system, this is the "Workgroup" name set on the Identification tab in Start -> Settings -> Control Panel -> Network. On NT 4, this name is found in the same place but is called the "Domain".

Also, replace local-machine-name with the name of your Solaris system so that it can connect to the swat Web server described later, and replace 192.168.1 with the first three components of the IP addresses used on your local network. The range 192.168.1.1 to 192.168.1.254 is reserved for private use and is a good choice to use for a local network. Note the presence of a dot after the partial IP address in the configuration file.

The effect of this basic configuration file is to allow access to your Solaris system from Windows machines on the local network only (those with IP addresses starting 192.168.1) and a password is not required to browse the Solaris system. The root file system is shared but is read-only and the /share directory is shared with both read and write access. Incoming connections to the Solaris system have a User and Group identity (uid and gid) of the "nobody" user by default.

This basic configuration file can be amended later, if you wish, to share only specific directories with other networked systems, to require the use of passwords and to allow printing. I recommend that the "swat" program is used (see later) to make further changes to the configuration file.



8. Check the configuration file:


It's advisable to check that Samba is happy with the basic configuration file. Type the following:

# cd /usr/local/samba/bin

# ./testparm   

and this should display the following:

Load smb config files from /usr/local/samba/lib/smb.conf

Processing section "[root]"

Processing section "[share]"

Loaded services file OK.

Press enter to see a dump of your service definitions

At this point, press ENTER to see a list of all the default options or type CONTROL and C to exit.



9. Arrange for inetd to start the Samba daemons:


Most of Samba's services are provided by means of three servers or daemons: smbd is the Samba server, nmbd is the NetBIOS name server and swat is a Web-based Samba configuration tool. These deal with incoming connections on ports 137, 139 and 901 respectively and we need to tell the Solaris internet daemon, inetd, to start the appropriate Samba daemons whenever an incoming request is received on these ports.

Edit /etc/services and make the following changes.

Immediately after the line which reads:

sunrpc111/tcprpcbind

insert the two lines:

netbios-ns      137/udp# Samba nmbd

netbios-ssn     139/tcp# Samba smbd

and, after the line which reads:

ldaps636/udp# LDAP protocol over TLS/SSL (was sldap)

insert the line:

swat 901/tcp# Samba swat

Now edit /etc/inetd.conf and add the following three lines to the end of the file:

netbios-ssnstreamtcpnowaitroot/usr/local/samba/bin/smbd smbd

netbios-nsdgramudpwaitroot/usr/local/samba/bin/nmbd nmbd

swatstreamtcpnowait.400root/usr/local/samba/bin/swat swat

If you have TCP wrappers installed (see Installing and configuring TCP Wrappers on Solaris), the three lines to be added should read:

netbios-ssnstreamtcpnowaitroot/usr/sbin/tcpd /usr/local/samba/bin/smbd smbd

netbios-nsdgramudpwaitroot/usr/sbin/tcpd /usr/local/samba/bin/nmbd nmbd

swatstreamtcpnowait.400root/usr/sbin/tcpd /usr/local/samba/bin/swat swat

Tell the inetd daemon to re-read its configuration file:

# pkill -HUP inetd

and Samba is installed and working.



10. Simple testing


Start up Windows Explorer on a Windows machine on your local network and look in Network Neighborhood. You should see an entry for your Solaris machine there and you should be able to browse the Solaris file system from the Windows machine. Using standard Windows drag-and-drop techniques, you should be able to copy files (as long as they have global read access) from the Solaris system to the Windows system.. You should also be able to copy files from Windows to directories on Solaris which have global write access, such as /tmp and /share.



11. Using swat


Swat is a Web server which runs on your local machine in response to HTTP connections on port 901. It provides a graphical interface for configuring Samba and access to some of Samba's documentation. To connect to Swat, simply start your Web browser and point it at:

http://localhost:901

If this doesn't work, replace "localhost" with the name of your Solaris machine.



12. And finally:


This page is not intended to be a complete guide to Samba. Its purpose is really to provide a step-by-step guide to installing Samba and making it work without having to plough through the voluminous documentation provided with the software.

Please do have a look at the documents in the /opt/source/samba/samba-2.0.6/docs/textdocs directory and the various useful HTML documents which you'll find on your machine in:

/opt/source/samba/samba-2.0.6/docs/faq/Samba-meta-FAQ-1.html

/opt/source/samba/samba-2.0.6/docs/faq/Samba-Server-FAQ-1.html

/opt/source/samba/samba-2.0.6/docs/faq/sambafaq-1.html


If you make further changes to the Samba configuration file smb.conf, note that the two Samba daemons should be told to re-read the file by issuing the commands:

# pkill -HUP smbd

# pkill -HUP nmbd


create a password file

/usr/sfw/bin/smbpasswd -a root


start samba

/etc/rc3.d/S90samba start