killall -u root 后如何重新登录到 root?

killall -u root 后如何重新登录到 root?

我做了一件傻事,按下了命令的回车键:

$ killall -u root

现在我们无法登录。最后运行的命令是:

ws4-clarind:~ # killall -u root
Connection to ws4-clarind.esc.rzg.mpg.de closed by remote host.
Connection to ws4-clarind.esc.rzg.mpg.de closed.
xxx@con99:~> ssh [email protected]
ssh: connect to host ws4-clarind.esc.rzg.mpg.de port 22: Connection refused

我怎样才能恢复 root 对服务器的登录?

答案1

此时您只能重新启动服务器,因为大量在启动时自动启动且对此类服务器功能不可或缺的进程已被终止,包括(可能)所有进程的父进程 init。您必须重新启动服务器。

答案2

如果您有本地物理服务器。连接监视器并使用 root 登录。登录后运行注释 #/etc/init.d/sshd 重启之后,您就可以远程访问 ssh

相关内容