Turn off SELinux:
setenforce 0
Disable SELinux for next system boot up / restart:
sed -i "s/^SELINUX=.*$/SELINUX=disabled/" /etc/selinux/config
Install samba application:
yum install samba samba-client samba-common -y
Set up samba to start at the next boot up:
chkconfig smb on
chkconfig nmb on
Set up firewall 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
Empty existing samba configuration:
> /etc/samba/smb.conf
Go to edit configuration in your way:
vi /etc/samba/smb.conf
Paste this content:
#======================= Global Settings =========================
[global]
workgroup = WORKGROUP
security = share
map to guest = bad user
#======================= Share Definitions =======================
[public]
path = /public
browsable =yes
writable = yes
guest ok = yes
read only = no
Create missing directory:
mkdir -p /public
Set the right permissions for this share:
chmod -R 0777 /public
Restart samba service:
service smb restart
service nmb restart
No comments:
Post a Comment