# 安装 telnet 避免 ssh 无法登录
yum -y install xinetd telnet telnet-server
# 允许 root 账号登陆
vi /etc/securetty
# 末尾添加两行
pts/0
pts/1
# 添加防火墙端口
vi /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 23 -j ACCEPT
# 重启服务关闭 firewalld
systemctl restart iptables
systemctl disable firewalld
systemctl stop firewalld
# 注册服务
systemctl enable telnet.socket
systemctl start telnet.socket
systemctl enable xinetd
systemctl start xinetd
干完以上之后,发现root账号怎么都登录不了,而且确认不是密码的问题
Password:
Login incorrect
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
查看日志tail -f /var/log/secure发现了报的错误信息
Jun 4 20:28:28 localhost login: pam_succeed_if(remote:auth): requirement "uid >= 1000" not met by user "root"
Jun 4 20:28:30 localhost login: FAILED LOGIN 1 FROM localhost FOR root, Authentication failure
Jun 4 20:36:10 localhost login: pam_securetty(remote:auth): access denied: tty 'pts/2' is not secure !
猜测是不是pts/2没有加入权限,重复 vi /etc/securetty步骤,
把pts/2加入末尾,登录就成功了