[root@lovn ~]# vi /etc/sysconfig/iptables # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT -A INPUT -j REJECT –reject-with icmp-host-prohibited -A FORWARD -j REJECT –reject-with icmp-host-prohibited COMMIT ~ ~ "/etc/sysconfig/iptables" 13L, 476C
-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 #像下面这样 # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -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 -A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT -A INPUT -j REJECT –reject-with icmp-host-prohibited -A FORWARD -j REJECT –reject-with icmp-host-prohibited COMMIT ~ ~ — INSERT — #重启防火墙,使规则生效 [root@lovn ~]# service iptables restart iptables:清除防火墙规则: [确定] iptables:将链设置为政策 ACCEPT:filter [确定] iptables:正在卸载模块: [确定] iptables:应用防火墙规则: [确定] [root@lovn ~]# #关闭系统的 SELinux(不关闭会无权限) [root@lovn ~]# vi /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing – SELinux security policy is enforced. # permissive – SELinux prints warnings instead of enforcing. # disabled – No SELinux policy is loaded. SELINUX=enforcing # SELINUXTYPE= can take one of these two values: # targeted – Targeted processes are protected, # mls – Multi Level Security protection. SELINUXTYPE=targeted
The system is going down for reboot NOW! #检查Samba服务包是否已安装 [root@lovn ~]# rpm -qa | grep samba samba-common-3.5.10-114.el6.i686 samba-winbind-clients-3.5.10-114.el6.i686 samba-client-3.5.10-114.el6.i686 samba4-libs-4.0.0-23.alpha11.el6.i686 #缺少相关包则安装 [root@lovn ~]# yum install samba Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * extras: centos.ustc.edu.cn * updates: centos.ustc.edu.cn Setting up Install Process Resolving Dependencies –> Running transaction check —> Package samba.i686 0:3.5.10-125.el6 will be installed –> Processing Dependency: samba-winbind-clients = 3.5.10-125.el6 for package: samba-3.5.10-125.el6.i686 –> Processing Dependency: samba-common = 3.5.10-125.el6 for package: samba-3.5.10-125.el6.i686 –> Running transaction check —> Package samba-common.i686 0:3.5.10-114.el6 will be updated –> Processing Dependency: samba-common = 3.5.10-114.el6 for package: samba-client-3.5.10-114.el6.i686 —> Package samba-common.i686 0:3.5.10-125.el6 will be an update —> Package samba-winbind-clients.i686 0:3.5.10-114.el6 will be updated –> Processing Dependency: samba-winbind-clients = 3.5.10-114.el6 for package: libsmbclient-3.5.10-114.el6.i686 —> Package samba-winbind-clients.i686 0:3.5.10-125.el6 will be an update –> Running transaction check —> Package libsmbclient.i686 0:3.5.10-114.el6 will be updated —> Package libsmbclient.i686 0:3.5.10-125.el6 will be an update —> Package samba-client.i686 0:3.5.10-114.el6 will be updated —> Package samba-client.i686 0:3.5.10-125.el6 will be an update –> Finished Dependency Resolution
Dependencies Resolved
================================================================================ Package Arch Version Repository Size ================================================================================ Installing: samba i686 3.5.10-125.el6 base 4.9 M Updating for dependencies: libsmbclient i686 3.5.10-125.el6 base 1.6 M samba-client i686 3.5.10-125.el6 base 11 M samba-common i686 3.5.10-125.el6 base 13 M samba-winbind-clients i686 3.5.10-125.el6 base 1.1 M