前言
为了防止某些眼睛不需要的人,逼逼赖赖自己ssh挂了,特别声明:
请你们先开启telnet服务,防止ssh挂掉
查看ssh服务状态
systemctl status sshd.service
输出:
● sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
Active: activating (start) since Fri 2021-05-07 18:11:36 CST; 2min 13s ag
解决办法:
先开启telnet登录,防止ssh挂掉
,登录不了(centos 7以上)
yum install xinetd telnet-server -y telnet
echo "pts/0" >> /etc/securetty
echo "pts/1" >> /etc/securetty
echo "pts/2" >> /etc/securetty
systemctl start telnet.socket
systemctl start xinetd
netstat -lntp|grep 23
删除服务
rm -f /usr/lib/systemd/system/sshd.service
重新生成服务
systemctl enable sshd
systemctl restart sshd.service
systemctl status sshd.service