====== SAMBA Installation On Solaris ====== ===== Introduction ===== The Samba software suite is a collection of programs that implements the SMB protocol for UNIX systems, allowing you to serve files and printers to Windows, NT, OS/2 and DOS clients - installs in /usr/local/samba. To use samba, you must also have installed the popt, libiconv, readline, ncurses and either the libgcc-3.3 or the gcc-3.3.2 packages. **** The versions of each package will change over time – A subsequent Samba install (HRIS 01/02/07) used the latest versions from the website **** The software was downloaded from http://www.sunfreeware.com/indexsparc9.html Before installing check server backups have completed. ===== Software Installs ===== #mkdir /export/home/support/samba-3.0.10 Note :- On the pkgadd command there may be a question regarding overwriting of existing files. Answer ‘Y’ ==== gcc-3.3.2 ==== check current installed version of package #pkginfo –l SMCgcc If version matches 3.3.2 then move onto next package Download the gcc-3.3.2-sol9-sparc-local.gz into /export/home/support/samba-3.0.10. Run #gunzip gcc-3.3.2-sol9-sparc-local.gz #pkgrm –v SMCgcc #pkgadd –d gcc-3.3.2-sol9-sparc-local ==== libiconv 1.9.2 ==== check current installed version of package #pkginfo -l SMCliconv If version matches 1.9.2 then move onto next package Download libiconv-1.9.2-sol9-sparc-local.gz Into /export/home/support/samba-3.0.10. Run #gunzip libiconv-1.9.2-sol9-sparc-local.gz #pkgrm -v SMCliconv #pkgadd -d libiconv-1.9.2-sol9-sparc-local ==== popt 1.7 ==== check current installed version of package #pkginfo -l SMCpopt If version matches 1.7 then move onto next package Download popt-1.7-sol9-sparc-local.gz Into /export/home/support/samba-3.0.10. Run #gunzip popt-1.7-sol9-sparc-local.gz #pkgrm –v SMCpopt #pkgadd -d popt-1.7-sol9-sparc-local ==== readline-5.1 ==== check current installed version of package #pkginfo -l SMCreadl If version matches 5.1 then move onto next package Download the readline-5.1-sol9-sparc-local.gz into /export/home/support/samba-3.0.10. Run #gunzip readline-5.1-sol9-sparc-local.gz # pkgrm -v SMCreadl #pkgadd -d readline-5.1-sol9-sparc-local ==== ncurses-5.4 ==== check current installed version of package #pkginfo -l SMCncurs If version matches 5.4 then move onto next package Download the ncurse-5.4-sol9-sparc-local.gz into /export/home/support/samba-3.0.10. Run #gunzip ncurse-5.4-sol9-sparc-local.gz # pkgrm -v SMCncurs # # pkgadd -d ncurse-5.4-sol9-sparc-locancurses-5.4 already loaded on server ==== samba 3.0.10 ==== Download the samba-3.0.10-sol9-sparc-local.gz into /export/home/support/samba-3.0.10. Run #gunzip samba-3.0.10-sol9-sparc-local.gz #pkgrm -v SMCsamba #pkgadd –d samba-3.0.10-sol9-sparc-local ==== Adjusting the configuration ==== 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: sunrpc 111/tcp rpcbind insert the two lines: netbios-ns 137/udp # Samba nmbd netbios-ssn 139/tcp # Samba smbd and, after the line which reads: ldaps 636/udp # LDAP protocol over TLS/SSL (was sldap) insert the line: swat 901/tcp # Samba swat The following entries have been added to /etc/inetd.conf so that the correct daemons startup after a server reboot:- # Samba daemons #netbios-ssn stream tcp nowait root /usr/local/samba/sbin/smbd smbd #netbios-ns dgram udp wait root /usr/local/samba/sbin/nmbd nmbd #swat stream tcp nowait.400 root /usr/local/samba/sbin/swat swat The configuration file for the samba system is smb.conf and this is situated in the directory /usr/local/samba/lib At time of writing the contents of the file for b0012dp are :- # Global parameters workgroup = All security = User encrypt passwords = yes smb passwd file = /usr/local/samba/private/smbpasswd unix password sync = yes hosts allow = localhost \ b0012dp \ 10.100. \ 10.111. \ 10.110. hosts deny = All #[root] # path = / # comment = Solaris root # guest ok = Yes # read only = Yes [mail01] path = /BCCMAIL01 comment = BCCMAIL01 guest ok = No read only = No [mail03] path = /BCCMAIL03 comment = BCCMAIL03 guest ok = No read only = No [share] path = /share comment = Solaris share guest ok = Yes read only = No #[itnet] # path = /export/home/itnet # comment = itnet_home # guest ok = Yes # read only = No Any line that starts with a hash (#) is treated as a comment and is not used by the system. The [mailnn] paragraphs sets out the UNIX directory that is shared out. Only the directory at the end of the path is actually shared. To add a new connection to the shared directory, the users IP Address of their PC needs to be added to the `hosts allow` line. Similarly, if access of a certain address is to be removed then that IP Address will need to be deleted from the line. 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. After each edit of the smb.conf file the smbd daemon will need to be re-started to pick up the changes. This is done by issuing the command #pkill –HUP inetd ==== User setup ==== Users need to be created within the Samba security file smbpasswd in /usr/local/samba/private. This is achieved through the smbpasswd command. #PATH=$PATH:/usr/local/samba/bin;export PATH # smbpasswd -a mail01 New SMB password: Retype new SMB password: ==== Desktop ==== Using example of b0012dp and mail01, mail03 If you enter c: net use m: \\b0012dp\mail01 on a desktop machine, with relevant permission, you should get access to the server. If you are already using m: you can assign any free drive. A second drive can be assigned to mail03 e.g c: net use n: \\b0012dp\mail03 Users can now `drag and drop` files from their PC to the UNIX server using normal Windows methods.