scientific linux root,在CentOS/RHEL/Scientific Linux 6 & 7 上安装Telnet

iptables与firewall的配置:

说明:

(1)如果不使用iptables与firewall可以将它们关闭,关闭的命令如下:

[root@ceshiji ~]# iptables -F

[root@ceshiji ~]# /etc/init.d/iptables stop

[root@rhel7 ~]# systemctl stop firewalld

[root@rhel7 ~]# systemctl disable firewalld

(2)Linux7中不再有iptables,使用firewalld;在Linux7中安装并使用iptables的方法如下:

[root@rhel7 ~]# yum install -y iptables-services

开启iptables服务:

[root@rhel7 ~]# systemctl start iptables

查看iptables服务运行状态:

[root@rhel7 ~]# systemctl status iptables

开机自启动iptables服务:

[root@rhel7 ~]# systemctl enable iptables

使用iptables:

[root@rhel7 ~]# vim /etc/sysconfig/iptables

加入如下行“-A INPUT -p tcp -m state --state NEW --dport 23 -j ACCEPT”

31b7ed3135d3142fed0be02f787ac452.png

说明:上面只是演示下linux7中iptables安装和使用,实际工作中在linux7中,我们使用的是firewall!

(3)开启iptables和firewall,让telnet的默认端口23可以通过防火墙和路由器。

在Linux 6系统中:

[root@ceshiji ~]# vim /etc/sysconfig/iptables

加入如下行“-A INPUT -p tcp -m state --state NEW --dport 23 -j ACCEPT”37397004bb7d7e2289baeace8992005a.png

保存退出!重启iptables服务。

[root@ceshiji ~]# service iptables restart

在Linux 7系统中:

[root@rhel7 ~]# firewall-cmd --permanent --add-port=23/tcp

[root@rhel7 ~]# firewall-cmd --reload

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值