Top Banner
UNIT - III
28

UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Dec 24, 2015

Download

Documents

Holly Payne
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

UNIT - III

Page 2: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Installing Samba• Windows uses Sever Message Block(SMB) to

communicate with each other using sharing services like file and printer.

• Samba makes icon of Linux computer to appear in Windows Network Places and files of Linux is made to be easily browsed by Windows Explorer.

Page 3: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• RHEL includes three samba packages :• 1. samba• 2. sambaclient• 3. samba-common• They are either installed during installation or they may be

not.• To verify use the command :• [root#] rpmquery –qa| grep samba

Page 4: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• If it is not installed the command will return samba is not installed and if it is installed RPM query returns the version number of the samba program installed.

Page 5: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

To install • 1. download the latest version from Samba website :

samba.org• 2. install it :• [root#] rpm –i samba(name of file)

where name of the file is the version number of file downloaded.

Page 6: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• 3. Download samba-common and sambaclient or else download zipped rpm version (samba-latest.tar.gz)

• Extract using following command• [root#] tar –xfvz samba-latest.tar.gz

Page 7: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• 4. change directory and use configure• [root#] cd /urs/src• [root#] ./configure• 5. execute :• [root#]make• [root#]make install• Samba is installed when command prompt returns.

Page 8: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Configuring Samba Server• Samba is needed to be configured before it connects to

Window PC.• Samba configuration file is smb.conf and it is located in

/etc/samba directory.• smb.conf is divided into several sections called shares.• Names of these sections are written in square brackets.

Page 9: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Global section in smb.conf• [global]• workgroup = TYIT• netbios name = Red Hat Linux• server string = Samba Server • security = SHARE• log file = /var/log/samba/log • smb passwd file =/etc/samba/smbpasswd• max log size = 50• dns proxy = No• encrypt passwords= Yes• load printers = yes

Page 10: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Explanation of global section• workgroup = TYIT is the name of the workgroup shown

in the identification tab of the network properties box on the Windows computer.

• netbios name = Red Hat Linux is the name by which the Samba server is known to the Windows computer.

• server string = Samba Server is the name of the Samba server.

•  log file = /var/log/samba/log is the location of the log file.

• max log size = 50 is the maximum size in kilobytes that the file can grow to.

Page 11: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• security = SHARE is the level of security applied to server access. Other possible options are user, the default setting; domain; and server.

• Using share makes it easier to create anonymous shares that do not require authentication, and it is useful when the netbios names of the Windows computers are different from other names on the Linux computer.

• Server is used if the password file is on another server in the network. Domain is used if the clients are added to a Windows NT domain using smbpasswd, and login requests are by a Windows NT primary or backup domain controller.

Page 12: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• dns proxy = No indicates that the netbios name will not be treated like a DNS name and there is no DNS lookup.

• encrypt passwords = yes while connecting to windows passwords will be encrypted.

Page 13: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Homes section in smb.conf• [homes]• comment = Home Directories• read only = No• writeable = yes• create mode = 0664• directory mode=0775• browseable = yes• max connections = 1

Page 14: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Explanation of home section• comment = Home Directories is a comment line• read only = No specifies that users can write to their

directories.• browseable = yes makes home directory browseable in

Windows browser.• create mode = 0664 sets read,write and execute

permissions for created directories.

•  

Page 15: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• directory mode= 0775 sets default read, write and execute permissions for created directories.

• max connections = 1 specifies number of simultaneous login. Setting 1 allows user to login only at one location. Setting 2 allows user to login from two locations and so on. Setting 0 will allow unlimited number of connections.

Page 16: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Printer section in smb.conf• comment = All Printers• path = /var/spool/samba • guest ok = Yes• print ok = Yes• browseable = Yes

Page 17: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Explanation of printer section• path = /var/spool/samba is the location of the printer

spool directory.• guest ok = Yes enables guest access to the printer.• print ok = Yes enables clients to send print jobs to the

specified directory.• This option must be set or printing does not work.• browseable = Yes means that the printer appears in the

browse list.•

 

Page 18: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• To check whether smb.conf is properly configured following command is used :

• [root#] testparm• Loaded services file OK.

Page 19: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Creating Samba Users• Samba users are created as any ordinary users but the

passwords are given using smbpasswd command :• [root#] useradd john• [root#] smbpasswd –a john• New SMB password :• Retype new SMB password:• Password changed for user john.

Page 20: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• To convert all of the system users to samba users :• [root#] cat /etc/passwd | mksmbpasswd.sh >

/etc/samba/smbpasswd• The above command creates only the users accounts not

their passwords.• Passwords for users is allotted individually by using the

smbpasswd command and their user’s name.

Page 21: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Starting the Samba Server• To start the samba daemon following are the steps :• 1. to start the samba daemon• [root#] service smb start• Starting SMB services :[OK]• The above command runs provided samba server is

configured.• It is configured to allow users who have accounts on

RHEL system to access their home directories from a Window PC.

• Logged-in users are also able to use the printers configured with the Red Hat system.

Page 22: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• 2. enable samba at system boot• [root#] chkconfig smb on

Page 23: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Connecting to Samba Client• One can easily connect the system to any computer that

is running the SMB protocol.• The connection can be made using two methods .• 1. using smbclient command• 2. using smbmount command

Page 24: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

smbclient command• # smbclient //computername/sharename• [root#] smbclient //MY_PC/C• Password :• Domain = [TYIT] OS=[Windows 5.0] • Server =[Windows 2000 LAN Manager]• smb:\>• Where MY-PC is the name of windows machine. Instead

of hostname , IP address can also be specified.

Page 25: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• This example shows logging into Windows PC from Red Hat system.

• Password was prompted to log in and it gave some information about windows system and a command prompt.

• This prompt is called as samba prompt.

Page 26: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

smbmount command • #smbmount //computer-name/sharename/mount point• [root#] smbmount //MY_PC/C/tyit• Password:• Where tyit is the directory on Red Hat Linux system to be

mounted.• After entering the password for windows machine ,

directory is changed to mounted directory.• [root#] cd /tyit• [root#] ls

Page 27: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

• Users can now easily move and open the files between two systems using regular file system utilities.

• There is a hidden file .sambafile which is created which has the username and password.

• To unmount the client file system, enter the smbunmount command :

• [root#] smunmount /tyit

Page 28: UNIT - III. Installing Samba Windows uses Sever Message Block(SMB) to communicate with each other using sharing services like file and printer. Samba.

Connecting from a windows PC to Samba Server

• 1. for systems running windows 2000 or xp , no configuration is required.

• On windows computer, double-click the My Network Places icon from the Desktop.

• 2. In the Network Places window , you should now see a listing for the Red Hat computer for eg;rhl10.

• Double click the rhl10 icon and the shares will be available.

• 3. a username and password will be prompted to enter the directories.

• Now sharing is available between Linux and Windows computers.