安装telnet-server及telnet服务
yum install -y telnet-server* telnet
安装xinetd服务
yum install -y xinetd
修改配置文件,没有则创建
vi /etc/xinetd.d/telnet
# default: yes
# description: The telnet server servestelnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server =/usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}
- 允许root用户telnet 登录,配置telnet登录的终端类型,在/etc/securetty文件末尾增加一些pts终端
pts/0
pts/1
pts/2
pts/3
查看
- 启动xinetd及telnet并做开机自启动
systemctl enable xinetd.service
systemctl enable telnet.socket
systemctl start telnet.socket
systemctl start xinetd.service
检验23端口是否可用
netstat -tnl |grep 23
-
验证配置
- 不重启验证
telnet localhost
重启服务器验证