环境:
OS:Centos 7
1.安装Telnet服务
要在CentOS 6上使用Telnet,需要安装telnet-server包。使用以下命令进行安装:
yum install telnet-server
[root@localhost ~]# yum -y install xinetd telnet-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base
解决办法:使用阿里云yum镜像,参考如下连接
https://www.cnblogs.com/hxlasky/p/18367611
2.启动服务
systemctl restart telnet.socket
systemctl restart xinetd
3.设置服务自启动
systemctl enable telnet.socket
systemctl enable xinetd
4.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
5.允许root用户登录
默认情况下,CentOS 7不允许root用户通过Telnet登录.要启用此功能,需要编辑 /etc/pam.d/remote 文件,注释掉以下行:
#auth required pam_securetty.so
6.客户端telnet登录
C:\Users\Administrator>telnet 192.168.1.101 23