2. Samba Service
Samba Server Setup
Fileand Printer Sharing from LINIX toWindows
Uses smbDaemon
service smb start/stop/restart
3. What isSamba??
Samba Server Setup
Sambais an Open SourceSuite, that provides seamlessfile and
print services to SMB/CIFSclients.
•
•
•
•
Sambais freely available.
With Samba,you can share aLinux files ystemwith
Windows and vice versa.
Youcan also share printers connected to either Linux ora
system with Windows.
Sambaenables aLinux or Unix server to function asafile
server for client PCsrunning Windows software.
4. What isSamba??
Samba Server Setup
What isSMB?
• SMBstands for – Server MessageBlock.
• It is a protocol by which a lot of PC-related machines
share files and printers and other information such as
lists of available files and printers.
• Operating systems that support this natively include
Windows, OS/2, and Linux.
What is CIFS?
• CIFS – Common Internet File System is a protocol
that is basically an updated SMB.
5. Components of SMB
Samba Server Setup
smbd daemon: Thisprovides the file and print services toSMB
clients suchasWindows or other Linux or Unixclients.
•
•
•
smb.conf: Thisis the configuration file forsmbd.
nmbd daemon: Thisdaemon provides NetBIOS
nameserving and browsing support.
smbclient: Thisis an smb client program that implement
a simple FTP-likeclient on aLinux or Unixbox.
6. Components of SMB
Samba Server Setup
•
•
•
testparm: This utility is used to test the smb.conf
configuration file.
smbstatus: Thisprograms lists the currentSamba
connections.
smbpasswd: Thisallows the user to change thepassword
used for their SMBsessions.
7. Installation andSetup
Samba Server Setup
Step 1. Install the required packages for Samba:
# yum install –y samba samba-common samba-client
Step 2. Verify the package installation:
# rpm -qa | grep samba
Step 3. Enable the service to start during boot:
# chkconfig smb on
Step 4. Verify that the service is set to start on boot:
# chkconfig smb --list
8. Samba ServerConfiguration
Samba Server Setup
cat /etc/samba/smb.conf Contain main configuration file
cat /etc/samba/smb.user Maps samba and Redhat users
cat /etc/samba/smb.passwd Contain samba user password
9. Make backup files
Samba Server Setup
Step1.
# cp /etc/samba/smb.conf /etc/samba/smb.bk
Step2.
# nano /etc/samba/smb.conf
Step3.
Saveandexit (ctrl+x)
Check the syntax of configuration file
# testparm
10. Add Users
Samba Server Setup
useradd user01
To add a local user: smbpasswd –a user01
Syntax: smbpasswd [option] user
-a Add a users
-e Enable a users
-d Disables a users
-x Delete a users
Verfiy a users
# pdbedit -w -L
11. Samba ClientConfiguration
Samba Server Setup
Share the Samba Directory on Windows machine
server1:/smbdata /users/smbdata smbfs defaults 00
or use
Syntax: smbclient [option]
-L Lists Samba shares
-U Define users to connect with
-P Defines the password to connect with