Note: The
telnet service is installed on the server to prevent the server from being unable to connect to the server again after the ssh service is interrupted, especially when upgrading the ssh service, enable telnet to avoid failure to connect to the server after the ssh upgrade fails, and it is also convenient to quickly restore the ssh service .
step1: Install telnet service on the server
yum install -y telnet-server
step2: Set telnet service status
cat <<EOF > /etc/xinetd.d/telnet
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = yes #改为 no 或者注释这一行
}
step3: configure permissions
**注意:**
默认情况下telnet连接后不能使用超级用户的,要使用超级用户,可以修改配置文件
Comment auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
this line
step4: Open the telent console (you can add it after the /etc/securetty file)
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
step4: Start the telnet service
systemctl restart xinetd.service