740 likes | 999 Views
Chapter. Linux/Windows Internetworking. Chapter Objectives. Samba Practical Customization of Samba on a Linux Server Setting Up SWAT to Remotely Configure Samba on a Windows Client. Origin of Samba. Samba was originally developed in Australia. The Purpose of Samba.
E N D
Chapter Linux/Windows Internetworking
Chapter Objectives • Samba • Practical Customization of Samba on a Linux Server • Setting Up SWAT to Remotely Configure Samba on a Windows Client
Origin of Samba • Samba was originally developed in Australia
The Purpose of Samba • Enable interoperability between Windows and Clients • Example: • Enables a Unix/Linux file server to be treated like a Windows NT file server by Windows clients • Enables an NT file server to be treated like a Unix file server by Unix/Linux clients ???
Some More Uses for Samba • A NetBIOS nameserver (1001/1002) • A FTP style SMB client to access PC shared items (disks and printers) for Unix, Netware or other operating systems. • A tar extension for the clients, in order to create remote backups. • A command line, limited administration tool, that supports some features of Windows NT that may be used over Samba, Windows NT Workstation or Server.
Yet, More Uses for Samba • Implementation of a password synchronization gateway, or printing gateway, between Unix and Windows NT. • Give access to Windows NT files from Unix. • Source: • http://www.linux-mandrake.com/guides71/en/mdkrefguide/samba-capability.html
Operating Systems for Samba • Linux • Solaris • IRIX • The main o/s for Silicon Graphics workstations and servers. It incorporates Unix System V functionality. • HPUX • Almost all other versions of Unix
Companies Using Samba • Cisco • Bank of America • Hewlett Packard • Johnson and Johnson • British Petroleum • Solomon Smith Barney (Citibank’s Investment Brokerage Division) Source: http://www.valinux.com/software/samba.html
Samba and Windows • Windows NT OS uses a layered architecture with partitioned user and kernel modes similar to those of UNIX. • NETBIOS – over – TCP/IP (NetBT) is used by Samba to share UNIX resources with Windows clients • SMB AND CIFS are NetBT based protocols for communication between clients and servers
SMB PROTOCOL • Created in 1987 as a joint venture between Microsoft and Intel • SMB is an acronym for Server Message Block • Excellent source on SMB • http://samba.anu.edu.au/cifs/docs/what-is-smb.html
Purpose of SMB • SMB, which stands for Server Message Block, is a protocol for sharing files, printers, serial ports, and communications abstractions such as named pipes and mail slots between computers http://samba.anu.edu.au/cifs/docs/what-is-smb.html
SMB Operation http://samba.anu.edu.au/cifs/docs/what-is-smb.html
SMB’s Place in the ISO-OSI Model http://samba.anu.edu.au/cifs/docs/what-is-smb.html
SMB Functions • 1) Session commands: used to set up a virtual circuit and validate access. • 2) File commands: permits an application to operate on files. • 3) Printer commands: permits an application to spool jobs to remote printers. • 4) Message commands: provide a means for passing alert, control, and informational messages between the consumer and server applications
CIFSCommon Internet File System • In 1997 Microsoft submitted CIFS specification to IETF • It is a derivation of SMB offered as a public domain specification
Kerberos Ticket Exchange Source: Samba Unix & NT Internetworking
Module Samba Installation and Usage
Obtaining Samba • Samba can be downloaded from www.samba.org • Samba is often supplied as part of the Linux package by vendors
Installing Samba • Samba is installed as one of the packages when installing Linux • Any RPM installation facility can be used for the installation of Samba • An example would be to use KDE’s package installation feature to install Samba
Samba Installation and Configuration Example • Source • http://www.linux-mandrake.com/guides71/en/mdkrefguide/samba.html
Samba Installation and Configuration Overview Install Samba from CD-ROM Configure Samba Server (samba.conf) Install Samba tools as necessary Test configuration and launch Samba Install SWAT GUI tool if desired
Installing Samba • If you already use Samba, run /etc/rc.d/init.d/smb stop. Otherwise, on the installation CDROM you will find the package named samba which you can install, as root, with command rpm -Uvh samba-*.
Smb.conf File • During installation a /etc/smb.conf file is copies to the computer • Entries in this file must be changed to configure Samba
Key Areas of Configuration • Global • Printers • Homes
Sample samba.conf • View • http://www.linux-mandrake.com/guides71/en/mdkrefguide/samba-conf.html
Global [global] netbios name = Zeus netbios aliases = creation # without these two entries, the first part of the # DNS name will be used instead. workgroup = DESIGN # Samba can only belong to one work group at a time server string = File server [%v] # this indicates the name and the version number to print
Global Cont. deadtime = 15 # maximal inactivity time auto services = john # this service, although present in the exploration list, is not available until john connects to the server security = user
Security Modes • Share mode • User mode • Server mode • Domain mode
Share Mode • {share mode}: In this mode, the client sends a password while asking for a connection, but no username is required. This mode is the default security mode for files or printers under Windows 95. It may be changed, under Windows 95 in the Network section of the Configuration Panel, under Access Control.
User Mode • {user mode}: This security mode is recommended. You are asked for a valid username and its associated password.
Server and Domain Mode • {server mode}: This mode is derived from user mode. The Samba server sends a session opening request to the passwords server. password server = NT_passerv #where NT_passerv is the name of the NT passwords server. Various servers may belisted. • {domain mode}: Nearly the same as server mode
Adding Hosts to Access the Linux server hosts allow = john.design.org 192.168.2. #Allows all users from john.design.org and all hosts with the beginning TCP/IP address 192.168.2. Deny 192.168.2.5 #Deny access from host 192.168.2.5
Creating a Guest Account guest account = pcguest # If you wish to add a guest user; to be # added in /etc/passwd
Setting Up a Share • First of all, create the shared directory with the command mkdir /home/shared and set owners and permissions with chmod and chown. • For example, chmod 0777 gives all rights towards this folder on the Unix side. However, Samba has to allow this too.
Commands to Create a Share • [share] • comment = share access granted to everyone • path = /home/shared • browsable = yes • writable = yes • create mask = 0750 • # means that the creator of the file has rwx • # rights on it, the group r-x and others r– • directory mask = 0750 • # same meaning but for directories • mangled names = yes • # converts names in a DOS/Windows manner, with • # eight characters for the name and three for the • # extension. • preserve case = no • # do not take case into account.
Another Share Example • [zip] • comment = automatically mount/unmount the zip drive • browseable = yes • path = /mnt/zip • root preexec = /bin/mount /dev/sda4 /mnt/zip • root postexec = /bin/unmount /mnt/zip First of all, be sure to load the ppa module with command modprobe ppa.o.
Creating Home Directory for Users • [homes] • comment = Home directories • browseable = no • writable = yes • path = /export/homes/%U • valid users = %S
Setting Up a Printer for Sharing • [printers] • comment = shared printers • path = /var/spool/samba • load printers = yes • # load all available printers • browseable = no • printable = yes • public = no • writable = no • create mode = 0700
Sample samba.conf File • [global] • workgroup = MyWorkGroup • server string = (Samba %v) • #server string = Samba Server • browseable = yes • printing = bsd printcap • name = /etc/printcap • load printers = yes • log file = /var/log/samba/log.%m max • log size = 100 • lock directory = /var/lock/samba • locking = no • strict locking = no • share modes = yes
Sample samba.conf File Cont. security = user null passwords = yes socket options = TCP_NODELAY # Allows the Samba server to become a domain controller #os level = 33 #domain master = yes # Facilitates the long names recognition preserve case = no short preserve case = no character set = iso8859-1
Sample samba.conf File Cont. [homes] comment = Home Directories preexec = /bin/sh -c 'echo /usr/bin/smbclient -M %m -I %I'& browseable = yes readonfiltered= no writable = yes create mode = 0750 public = yes
Sample samba.conf File Cont. ["public"] comment = "Public" path = /public/ browseable = yes hide dot files = yes readonfiltered= no public = yes pritable = yes #create mode = 0775 printable = no
Sample samba.conf File Cont. ["printers"] comment = All Printers #path = /var/spool/samba path = /var/spool/lpd/lp browseable = yes # Set public = yes to allow user 'guest account' to print guest ok = yes writable = yes printable = yes
Set Temporary File Space [tmp] comment = Temporary file space path = /tmp read only = no public = yes
Check for Changes Made • Now save changes to smb.conf • Before launching smb and nmb daemons, launch testparm. This command will read /etc/smb.conf and print which entries will be taken into account
Reload Samba • No need to reboot the computer • Reload Samba using Unix command to activate the new configuration • samba stop • samba start
Using the Command Mode to Reload Samba • Then just type /etc/rc.d/init.d/smb start. The following messages should be printed: Starting SMB services: [OK] Starting NMB services: [OK] To check that the daemon is running, run ps aux | grep smbd or /etc/rc.d/init.d/smb status
End of Samba Configuration • The Samba server is now ready for use
Accessing Linux File Server from a PC Client • Login on a PC Client using a guest ID and password preset at Linux server • Open Network Neighborhood • The Linux server should show up as it were in a NT network • Shared Resources Shown • Printer(s) • Public folder – [tmp] • Private folders [homes] [client-name]