Guide for setting up Samba v 2.0.* on an Indy running IRIX 6.5.*
This is an account of how I set
up 'Samba' v 2.0.5a on my Indy running IRIX 6.5.4. My earlier account , written in
of setting up 'libdes' v 4.01 encryption with an early version of Samba, is still available. This newer guide provides an easier way to
set up Samba, as Samba v 2.0.* already contains encryption modules and it can be obtained
already compiled for IRIX 6.*, all ready to install.
Three steps are needed: 1. Obtain the latest 'samba' 'tardist' file. 2. Install and configure 'samba' on the Indy. 3. Start the 'smbd' Samba daemon to run the 'smb' service and 'nmbd'.
1. Obtaining the latest 'samba' 'tardist' file
2. Installing and configuring 'samba' on the Indy
Preparing a 'smbpasswd' file
3. Starting the 'smbd' Samba daemon to run the 'smb' service
Using the '/usr/samba/bin/smbpasswd' script to alter the 'smbpasswd' file's passwords
Updating Samba when new versions are released
Documents and other assistance
I downloaded the latest tardist version of Samba 2.0.* from ftp://se.samba.org/pub/samba/Binary_Packages/IRIX/ It is called 'samba6x.2.0.5a.tardist'. This is Samba version 2.0.5a for IRIX 6*. If so, use them. . (Note added 5 November 2001: there is a newer version called samba v 2.2.2).
I put it in /tmp/ and used 'Toolchest | System | Software manager' to open it as a Customized installation. There were no conflicts so I started the installation. Later, I removed the unzipped files after I had made the 'smbpasswd' file as described below.
This installation puts the Samba and nmb files in the '/usr/samba' directory.
I made an empty file called '/etc/rc2.d/S81samba' and linked it to /etc/init.d/samba. It starts the 'smb' (Samba) and 'nmbd' daemons when the computer starts up.
I checked the file /etc/inetd.conf. This is the configuration file for '/etc/initd' which starts several processes including the 'SWAT' web server, see below. It contained several lines which were put there during the installation of Samba. These were::
swat stream tcp nowait root /usr/samba/bin/swat swat
There is an interactive set of options in a program called 'SWAT' which provides an easy way to alter the Samba configuration file called '/usr/samba/lib/smb.conf', using a web browser. Start a web browser and enter 'http://localhost:901'. The SWAT server has already been installed on port 901 by the installation, so it will open after you have entered the name and password of the superuser, usually 'root'.
I configured it as follows:
workgroup: bhfcig (changed from the default WORKGROUP)
netbiosname: sprysgi (added)
server string: Samba (unchanged)
interfaces: 184.108.40.206/24 (added) Note: This is the IP address of the Indy with '/24' to provide a netmask '255.255.255.0')
security: user (default)
encrypt passwords: yes (changed from the default no) Note: I have PCs running NT v 4.0 service pack 4 so I needed to use encrypted passwords under Samba.
update encrypted: (No, default)
guest account: guest (changed from the default nobody)
hosts allow (blank, default)
hosts deny (blank, default)
log level: 1 (default)
max log size: 50 (default, 50-KB)
socket_options: TCP_NODELAY (default)
print command: (default, usr/samba/bin/sambalp %p %s %U %m)
os level: 64 (changed from the default 'blank')
preferred master: Yes (changed from the default 'No')
local master: Yes (changed from the default 'No')
domain master: Yes (changed from the default 'No')
wins server: blank (default)
wins support: Yes (changed from the default 'No')
I entered these so that each user, the printers, guest and the CD-ROMs were shared and able to be used on the network. There is help for each entry. It is worth reading each of these carefully. This is the hardest part of the installation to get right, at least for me!
a 'smbpasswd' file
I made a directory called '/usr/samba/private'. I then made a 'smbpasswd' file for this new directory using a shell script called 'mksmbpasswd.sh'. Unfortunately this part of the Samba suite is not included in the 'tardist' distribution, even though /usr/samba/docs/textdocs\ENCRYPTION.TXT states: "The mksmbpasswd.sh program is found in the Samba source directory." You have to obtain it from the source distribution of Samba. To do this, I downloaded samba6x.2.0.5a.tardist to /tmp. Then I typed 'gunzip samba6x-2.0.5a.tar.gz' then 'tar xvf samba6x-2.0.5a.tar'. This created a directory '/tmp/samba-2.0.5a/source/script' which contained several scripts, including 'mksmbpasswd.sh'. I copied 'updatesmbpasswd.sh', 'addtosmbpass', 'mksmbpasswd.sh' and 'convert_smbpasswd' to '/usr/samba/private'.
Then I changed directories to /usr/samba/private and typed
- chmod 750 updatesmbpasswd.sh addtosmbpass mksmbpasswd.sh convert_smbpasswd
- cat /etc/passwd | ./mksmbpasswd.sh > /usr/samba/private/smbpasswd
I noted that the 'smbpasswd' file contained 'Xs' in groups of 32. I altered permissions for this directory and file:
- cd /usr/samba/private/
- chmod 600 smbpasswd
- cd ..
- chmod 500 private
I stopped the samba and nmbd daemons with:
- /etc/init.d/samba stop
- /etc/init.d/samba start
This started the smbd and nmbd in the same way as starting the computer.
Note: Both smbd and nmbd can be stopped, started or restarted in the 'SWAT', 'STATUS' options.
to check that it was OK. This showed that the Samba daemon was running.
the '/usr/samba/bin/smbpasswd' script to alter the 'smbpasswd' file's passwords
The '/usr/samba/private/smbpasswd' file that I created as described above, contains 'Xs' instead of passwords for users who want to connect to the Indy from PCs. The presence of the 'Xs' prevents connection to samba shares by default. For this reason I ran the '/usr/samba/bin/smbpasswd' script so that I could enter the passwords one by one into this file. I entered them for 'root' and each 'human' user. I did not alter the ones for 'ftp', 'guest' etc as smbpasswords are only needed for connections that use samba, not 'ftp', 'telnet' etc. that bypass it. Only 'suidroot' could change the 'smbpasswd' in my configuration so when users alter their IRIX password they will have to be altered for 'smbpasswd' by root as well.
This is simple. Download the new *tardist file to /tmp. Start software manager and tell it to do a 'custom installation' of /tmp/*tardist. It will unpack the tardist file and install it in '/usr/samba' when you click on 'start'. Run /etc/init.d samba stop ; /etc/init.d samba start in a shell as superuser, to restart the samba and nmb daemons after the installation has completed. The automatic installation will overwrite the out-of-date Samba files and create new ones in the '/usr/samba' directory and subdirectories. I suggest that you look at these and the README there to see what was done. Upgrades should not alter the current /usr/samba/lib/smb.conf file.
Note that in Samba v 2.0.6
(a) You can enable all printers on your system to be used by samba, by running the script '/usr/samba/scripts/mkprintcap.sh'. This creates a file called '/usr/samba/printcap', containing the names of the printers configured on your system. You will also have to add the line 'printcap name = /usr/samba/printcap' under the [global] section of '/usr/samba/lib/smb.conf', so that Samba know that you will be using this file and not '/etc/printcap', which is the default file. If you want to do this, you might also like to install the Common Unix Printing System (CUPS) as this provides an excellent way to set up and use printers on IRIX. I have a 'Guide' to installing CUPS which explains how to do this.
(b) This update configures samba to run as daemons by the script ' /etc/init.d/samba' and the file /'etc/config/samba'. You can 'enable' or 'disable' samba, using 'chkconfig': Typing in a shell as superuser 'chkconfig samba on' will set samba to start when you restart the computer and 'chkconfig samba off' will do the reverse. 'chkconfig' alone, will list the processes and whether they are on or off. If you would prefer to have samba started by 'inetd', you can run the script '/usr/samba/inetd.sh'. I did not do this, as the 'chkconfig' options can be useful. If you do use '/usr/etc/inetd' to start and stop Samba, the command to do so is 'etc/killall -HUP inetd'. This stops and restarts all the processes listed in '/etc/inetd.conf'. Note that 'swat', the utility to control Samba, is still present in '/etc/initd.conf' so is stopped and started using the 'etc/killall -HUP inetd' command.
The Samba web pages are at Samba.org where there are links to Samba web and download sites, etc.
See /usr/samba/docs which is up
to date and contains all the information I needed. Online, the documentation is at http://uk.samba.org/samba/samba.html.
There are also online and printed books on Samba:
Mailing lists on Samba can be joined or read by visiting http://samba.anu.edu.au/listproc/
Troels Arvin has information on Samba and Linux at http://www.mdb.ku.dk/tarvin/samba/sambaII/ including setting permissions on the /usr/samba/locks directory (read and execute for all) to allow the Samba server to be seen in Microsoft's 'network neighbourhood'.
This is a useful program that can be used to copy files and directories to and from shared resources on PCs.
Here are two examples of how I
(a) To copy all directories and files from a shared resource (called '\\stubbspc\d') on a PC called 'stubbspc' to a directory called 'backup' on my Indy, using 'smbclient' on the Indy.
First, make a directory called '/backup' on the Indy and 'cd' to '/backup'
Type the following commands on the Indy. I have left out the replies from the PC.
(This connects the Indy to the shared resource 'd' on the host PC computer called 'stubbspc'. If you get a reply that it can not load a 'codepage', alter the permissions of the directory and files in '/usr/samba/lib/codepages' so that they can be read by everyone). You will see a prompt 'smb: \>' when you have connected successfully.
(This sets the Indy's directory to 'backup'.
(This lists the directories on the host '/stubbspc/d')
(This sets files and directories on the host to be acted on recursively).
(The host will not prompt the user for each directory or file to tranxfer).
(Put a directory name in place of <nameofthedirectory> and add the '*' to get all the files in this directory and below. This copies all files and directories in <directory> to the current directory on the client Indy (/backup).
The files are copied at about 40 MB/min on my network, e.g. about 1-GB in 30 minutes.
(b) To update using '/usr/samba/bin/smbclient', a file called '/usr/people.tar.Z' in a shared resource called '\\sprynt\d' on my PC called 'sprynt' by copying it automatically from the Indy at 20:00 each Monday night using cron, I have in my '/var/spool/cron/crontabs/cspry' file, the single, long line:
0 20 * * 1 cd /usr; /usr/samba/bin/smbclient file://sprynt/d <mypassword> -U cspry -c 'put people.tar.Z ; del people.tar.Z.Mon ;rename people.tar.Z people.tar.Z.Mon'
Leave the punctuation and quotation marks exactly as in the above line.
Return to the 'home page'
Return to the `Computing index page'