centos7安装telnet
安装telnet-server
Telnet服务在CentOS7上是单独的一个服务,不用安装xinetd,只要安装telnet-server,然后启动telnet服务就可以了。
yum install telnet-server
启动telnet服务
systemctl enable telnet.socket
systemctl start telnet.socket
启用root用户登录
如果要使用root用户登录,也是需要在/etc/securetty文件中添加pts终端入口的(pts/0代表登陆的终端第一个,pts/1代表第二个)
vim /etc/securetty
......
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
另:centos6安装telnet
安装telnet-server
在CentOS6中,telnet服务是由xinetd管理的,没有单独的服务。
yum install xinetd telnet-server
配置文件,启用telnet服务
由于是xinetd服务管的,配置文件都在/etc/xinetd.d目录下
修改/etc/xinetd.d/telnet文件,只要把其中的“disable = yes”改为“ disable = no”,就是启用telnet服务了。
vi /etc/xinetd.d/telnet
修改完,重启xinetd服务就可以了。
chkconfig xinted on
service xinetd restart
启用root用户登录
如果要使用root用户登录,也是需要在/etc/securetty文件中添加pts终端入口的(pts/0代表登陆的终端第一个,pts/1代表第二个)
vim /etc/securetty
......
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
使用telnet客户端远程登录
要使用telnet客户端,需要先安装telnet客户端软件。
yum install telnettelnet命令格式:telnet 远程服务器IP地址或主机名 远程服务器telnet服务端口