Enable Samba server in CentOS 6.3
- Install Samba
yum install samba samba-common
- Edit Samba config file
vi /etc/samba/smb.conf
- In the [global] section
security = user
passdb backend = tdbsam
# Set to follow symbolic links
follow symlinks = yes
wide links = yes
unix extensions = no
- In the [homes] section
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mask = 0664
directory mask = 0775
- Enable Samba in run levels 2, 3, 4, 5
chkconfig --levels 2345 smb on
- Start the just installed Samba
/etc/init.d/smb start
- Add users with default password as user name
for i in user1 user2 user3 user4 user5
do
echo -e $i\\n$i | smbpasswd -a -s $i
done
- Add these lines to /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
- Restart iptables
service iptables restart
- Let SELinux enable Samba home dirs
setsebool -P samba_enable_home_dirs on
For more details, see
http://wiki.centos.org/HowTos/SetUpSamba
No comments:
Post a Comment