To install the samba package,run the following command:
yum install samba samba-client samba-common
Check the version of installed samba software by using the below command:
smbd --version
Configure the samba service, so that, it will start automatically at boot time:
chkconfig smb on chkconfig nmb on
Disable the SELinux:
nano /etc/selinux/config SELINUX=disabled
Now add these Iptables rules:
iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT service iptables save
Than edit the configuration file:
nano /etc/samba/smb.conf [global] workgroup = WORKGROUP server string = Samba Server %v netbios name = centos security = user map to guest = bad user dns proxy = no #============================ Share Definitions ============================== [Anonymous] path = /samba/anonymous browsable =yes writable = yes guest ok = yes read only = no