2010年6月18日 星期五

Config Samba

1. Kiem tra samba da duoc cai dat chua
# rpm -qa | grep samba
2. Cai dat samba (RPM)
# rpm -lvh samba-common-3.0.25b-1.el5_1.4.i386.rpm
# rpm -lvh samba-client-3.0.25b-1.el5_1.4.i386.rpm
# rpm -lvh samba-3.0.25b-1.el5_1.4.i386.rpm
# rpm -lvh system-config-samba-1.2.39-1.el5.noarch.rpm
2-1. Cai dat samba (YUM)
# yum install samba
3. Tao thu muc chia se
# mkdir /share
4. Cap quyen truy cap thu muc
# chmod 777 -R share
5. Cau hinh smb.conf
# vi /etc/samba/smb.conf
encrypt password = yes
workgroup =
interfaces = lo eth0 xxx.xxx.xxx.xxx/xx
host allow = xxx.xxx.xxx.xxx (day IP duoc phep truy cap)
security = user ( su dung Authenticate )
smb passed file = /etc/samba/smbpasswd
passdb backend = smbpasswd ( ma hoa password )
[share]
comment = share folder
path = /share
public = yes
writable = yes
printable = no
6. Tao SElinux label cho thu muc share
# chcon -t samba_share_t /share
7. Kiem tra lai
# ls -ldZ /share
8. Tao user truy cap
# useradd test
# passwd test
9. Ma hoa password
# cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd
10. Cam quyen doc va ghi cho user root
# chmod 600 /etc/samba/smbpasswd
11. Tao mat khau cho nguoi dung samba
# smbpasswd test
12. Khoi dong samba
# service smb start
13. Cau hinh port 139, 445, ... o Iptables hoac tat iptables
# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state -m tcp --dport 137 --state NEW -j ACCEPT
-A INPUT -p tcp -m state -m tcp --dport 138 --state NEW -j ACCEPT
-A INPUT -p tcp -m state -m tcp --dport 139 --state NEW -j ACCEPT
-A INPUT -p tcp -m state -m tcp --dport 445 --state NEW -j ACCEPT
# service iptables stop

沒有留言:

張貼留言