Documente Academic
Documente Profesional
Documente Cultură
Samba Service
What is Samba??
What is Samba??
What is SMB?
• SMB stands for – Server Message Block.
• 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.
Samba Server Setup
Components of SMB
smbd daemon: This provides the file and print services to SMB
clients such as Windows NT or other Linux or Unix clients.
• smb.conf: This is the configuration file for smbd.
• nmbd daemon: This daemon provides NetBIOS
nameserving and browsing support.
• smbclient: This is an smb client program that implement a
simple FTP-like client on a Linux or Unix box.
• smbmount: This mounting program enables mounting of
server directories on a Linux or Unix box.
Samba Server Setup
Components of SMB
Continued…
hosts allow = 192.168.1 127.
printcap name = /etc/printcap
load printers = yes
guest account = pcguest
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
[homes]: This section allows network clients to connect to a
user’s home directory without having an explicit entry in the
smb.conf file.
Examples:
[homes]
browseable = no
writeable = yes
Samba Server Setup
Continued…
[printers]: This section is used to specify which printers
are available.
Examples:
[printers]
print ok = yes
printer name = lp_mine
path = /home/everyone
[printer_share_name]
comment = Fred's Printer
valid users = fred
path = /var/spool/samba
printer = freds_printer
public = no
writable = no
printable = yes
Samba Server Setup
Authentication Methods
1.4
Directory (/manoz) and valid (AARAV) user has been created.
Step 3rd. Now we get the knowledge of our system’s IP address and who has been made by us is being connecting or not.
1.5
Now we got system’s IP address. But there is error in connection. Now we have to
troubleshoot this connection error for this valid user.
Step 4th. In the next step we open the samba server configuration file.
Command: vim /etc/samba/conf/smb.conf
1.6
This is configuration file.
1.7
This is also a part of configuration file.
Step 5th. Last page of configuration file we make some changes here.
1.8
After saving changes safely we came out from this configuration file.
Step 6th. Now we check the context of directory (/manoz).
Command: ls –lZ /manoz
1.9
Context of the directory is default now we make it samba because directory is shared by particular Samba server.
Step 7th. For changing the context of the directory we have to set boolians of the samba server.
1.10
Using getsebool command we can turn on the Booleans of samba.
Step 8th. Now we set context of directory as samba.
Command: chcon –R –t samba_etc_t /manoz
1.11
Context changed of directory successfully.
Step 9th. Now we try to connect the user.
Command: smbclient //192.168.0.12/manoz –U AARAV
1.12
Connection is successfully done.
Step 10th. Check the shared directory.
Command: ls
1.13
Shared directory is there.
Samba Server Setup
# mkdir santosh
# cd santosh
# ls
# ls
Samba Server Setup
# nano /etc/samba/smb.conf
(Go to end of config file i.e from public and remove the comments)
Make following ammendment
[santoshshare] (by replacing [public])
Comment = My share files
Path = /santosh
Public = yes
Browseable = yes
Valid users = santosh
Writable = no
Hosts allow = 192.168.1. (only 3 octets)
(save and exit)
Samba Server Setup