Redhat installation configuration Samba to achieve win shared Linux host directory
I. Preparation before installation
1, using the Samba server requires the firewall to open the following ports
UDP 137 UDP 138 TCP 139 TCP 445
#配置防火墙端口 www.2cto.com
[Root@roothomes ~] Vi/etc/sysconfig/iptables
-A input-m state--state new-m tcp-p TCP--dport 139-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 445-j ACCEPT
-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
#重启防火墙 to make the rule effective
[Root@roothomes ~]/etc/rc.d/init.d/iptables Restart
2, close the CentOS6 system SELinux
[Root@roothomes ~] Vi/etc/selinux/config
#SELINUX =enforcing #注释掉
#SELINUXTYPE =targeted #注释掉
Selinux=disabled #增加
#:wq save.
#重启系统 www.2cto.com
[Root@roothomes ~] Shutdown-r now or init 6
Ii. installation of Samba
1. Check if the Samba Service pack is installed
[root@roothomes ~] RPM-QA | grep Samba
Samba-3.5.4-68.el6.x86_64
Samba-common-3.5.4-68.el6.x86_64
Samba-client-3.5.4-68.el6.x86_64
Samba4-libs-4.0.0-23.alpha11.el6.x86_64
Samba-winbind-clients-3.5.4-68.el6.x86_64
Description Samba has been installed, if not installed, run the following command to install [root@roothomes ~] Yum Install Samba
2. Configure Samba
[Root@roothomes ~] chkconfig smb on #设置 samba boots up automatically
[Root@roothomes ~] Service SMB start #启动Samba服务
[Root@roothomes ~]/ETC/INIT.D/SMB Restart #重启
[Root@roothomes ~]/ETC/INIT.D/SMB Stop #停止
[Root@roothomes ~] Cp/etc/samba/smb.conf/etc/samba/bak_smb.conf_bak #备份
[Root@roothomes ~] cp/etc/samba/bak_smb.conf_bak/etc/samba/smb.conf #恢复
[Root@roothomes ~] vi/etc/samba/smb.conf
[Global] #找到这一行 (Global Settings tab), add the following line below this row:
Workgroup = Workgroup #工作组名称改为 the workgroup name defined by the Windows network
Server string = Samba Server #设置samba服务器的主机名称
Security = user #设置samba服务器安全级别为user, i.e. access by account and password
NetBIOS name = Sambaserver #设置Samba服务器访问别名