Installing and Configuring SAMBA Server on Linux

Опубликовано: 30 Март 2026
на канале: ARN Tech Trainings
736
13

SAMBA SERVER :
• The whole point of networking is to allow computers to easily share information. Sharing
information with other Linux boxes, or any UNIX host, is easy—tools such as FTP and NFS
are readily available and frequently set up easily “out of the box”. Unfortunately, even the
most die-hard Linux fanatic has to admit the operating system most of the PCs in the world
are running is one of the various types of Windows. Unless you use your Linux box in a
particularly isolated environment, you will almost certainly need to exchange information
with machines running Windows.

Steps to configure SAMBA server:
Step1:- Check and Install the SAMBA package, if not installed
#rpm –q samba

Install the package using yum
#yum install samba* y (or) yum install samba* portmap xinetd -y

(or )

yum -y install samba samba-client samba-common samba-winbind samba-winbind-clients

Step2:- Make a directory and assign full permission to it ,which will be shared
#mkdir /ktsamba
#chmod 777 /ktsamba

Step3:- Check the context of the directory and change it according to samba
#ls –ldZ /ktsamba
#chcon –t samba_share_t /ktsamba
#ls -ldZ /ktsamba

Step4:- Create a user or use any existing user who will be allowed to log in as samba user, add that user to samba user.

As we have a existing user “ktuser”, let’s just make it samba user
#smbpasswd –a username
#smbpasswd –a ktuser

Give password twice and wait till it add the user

Note:- To delete a user from samba use #smbpasswd –x user name

To check all the samba user use
#pdbedit –L

Step5:- Go to the configuration file i.e. /etc/samba/smb.conf and make the following changes

• Open the /etc/samba/smb.conf and copy the last seven lines shown below and paste it
at the last to edit it.

Once pasted remove “;” mark before it and change it according to following picture

Explanation about the above fields:
• [ktshare] : Share Name
• Comment = Public Stuff : Comment
• Path = /ktsamba : Share Directory
• Public = no : Public Access (Every user in network)
• Valid user = ktuser : Authorized user
• Writable = yes : Write Permission
• Printable = yes : Print permission
• Host allow= 192.168.10. : Network Range or host range

Note:- 192.168.10. Represent entire 192.168.10 network

[ktsamba]
comment = DevData
path = /ktsamba
public = yes
writable = yes
printable = no
write list = ananth
hosts allow = 192.168.

Step5:- Test the samba parameters andrestart the service and make it enable after reboot
• To test the parameters us the following command
#testparm

We have to restart two services here, #smb and #nmb and make it add to enable after reboot
#service smb restart
#service nmb restart

#chkconfig smb on
#chkconfig nmb on

Need to run the below on samba server:
iptables -I INPUT -p tcp -m tcp --dport 138 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 139 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 445 -j ACCEPT
iptables -I INPUT -p tcp -m tcp --dport 187 -j ACCEPT

Windows as a samba client:
To connect from windows to the samba server, Right click on My Computer icon select

Give the address of samba server as \\192.168.10.93\ktshare(sharename), press on finish to continue.

It will prompt for user name and passwd, give samba user and passwd and click on OK

Now a window will be opened, start adding some data to it from both sides.

Linux as client of SAMBA:
• Log into Linux machine and install samba client package

#yum install samba-client

• To connect to the samba server use the following

• Check the share name of that samba server by using following command
smbclient -L jumbo -U ananth -I 192.168.223.129

• To mount the SAMBA directory on remote Linux client
mount –t type of fs //server IP address/share name /mount point -O user= user name

#mkdir /sbclient

#mount -t cifs -o user=ananth,password=amma@2000 //192.168.223.129/ktshare /smbclient

active directory,Unlocking SAMBA Server: How to Connect Windows and Linux,samba server linux, samba file server, configure samba server, how to setup samba server, how to setup samba, how to set up samba, install and configure samba server in centos 7, how to configure samba server, install and configure samba, samba server configuration, how to install and configure samba server in linux centos 7, samba server, install and configure samba server, samba, how to configure samba server in centos 7, samba in linux, how to install samba server,linux samba server,linux smb,samba access,samba client,samba configuration,samba for windows,samba guide,samba install,samba installation,samba network,samba server for windows,samba server in linux,samba server setup,samba setup,samba share setup,samba sharing,samba software for linux,samba tutorial,samba ubuntu,samba user management,sambaserver,smb configuration,smb file transfer,Samba: The Secret Sauce for Seamless Windows & Linux Integration,Samba,Installing and Configuring SAMBA Server on Linux