一、检查系统有没有安装过telnet包
rpm -qa|grep telnet
rpm -qa | grep telnet-server
rpm -qa | grep xinetd
————————————————
二、卸载已安装的rpm包(包名参考上一条命令查询的结果)
rpm -e telnet–.*.x86_64
rpm -e telnet-server–.*.x86_64
rpm -e xinetd–.*.x86_64
————————————————
三、通过rz命令上传telnet rpm安装包
————————————————
四、安装rpm包centos防火墙开放端口,此处省略上传文件步骤,我用的winscp上传的,各位自便
安装顺序:xinetd–》telnet–》telnet-server
rpm -ivh
xinetd-2.3.15-14.el7.x86_64.rpm
rpm -ivh
telnet-0.17-65.el7_8.x86_64.rpm
rpm -ivh
telnet-server-0.17-65.el7_8.x86_64.rpm
————————————————
五、查看已安装telnet包版本
[root@kps4 src]# rpm -qa|grep telnet
结果如下:
telnet-server-0.17-65.el7_8.x86_64
telnet-0.17-65.el7_8.x86_64
————————————————
六、配置telnet登录的终端类型,在/etc/securetty文件末尾增加一些pts终端centos防火墙开放端口,如下
pts/0
pts/1
pts/2
pts/3
编辑
vim /etc/securetty
tail -5 /etc/securetty
查看配置类型,如下
xvc0
pts/0
pts/1
pts/2
pts/3
————————————————
七、启动telnet服务,并设置开机自动启动
systemctl enable xinetd
systemctl enable telnet.socket
systemctl start telnet.socket
systemctl start xinetd
netstat -lntp|grep 23
启动结果如下:
tcp6 0 0 :::23 :::* LISTEN 1/systemd
————————————————
八、防火墙开放23号端口
firewall-cmd –zone=public –add-port=23/tcp –permanent
重新加载防火墙
firewall-cmd –reload
————————————————
九、检测ssh 可以正常登陆,使用ssh登陆,然后停止telnet服务并移除
systemctl stop telnet.socket
systemctl stop xinetd
systemctl disable xinetd
systemctl disable telnet.socket
限时特惠:本站每日持续更新海量展厅资源,一年会员只需29.9元,全站资源免费下载
站长微信:zhanting688