曲径通幽论坛

标题: 开启 SSH 服务 及 关闭防火墙服务 [打印本页]

作者: beyes    时间: 2008-12-6 15:29
标题: 开启 SSH 服务 及 关闭防火墙服务
1、开启 SSH服务:
chkconfig --level 25 sshd on    #打开sshd服务
service sshd restart                   #重启sshd服务


2、关闭防火墙服务(CENTOS 环境)

#/sbin/iptables -I INPUT -p tcp –dport 80 -j ACCEPT
#/sbin/iptables -I INPUT -p tcp –dport 22 -j ACCEPT
#/etc/rc.d/init.d/iptables save
这样重启计算机后,防火墙默认已经开放了80和22端口


这里应该也可以不重启计算机:
#/etc/init.d/iptables restart


防火墙的关闭,关闭其服务即可:
查看防火墙信息:
#/etc/init.d/iptables status


关闭防火墙服务:
#/etc/init.d/iptables stop




欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2