一台 OpenVZ 的 VPS ,在重启后 SSH 服务无法启动,仅能通过管理后台使用 “Serial Console” 登录
目前出问题的 VPS 的所有进程:
root@ssd:/# ps auxf
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 1.0 2504 1360 ? Ss 09:50 0:00 init
root 2 0.0 0.0 0 0 ? S 09:50 0:00 [kthreadd/1980]
root 3 0.0 0.0 0 0 ? S 09:50 0:00 \_ [khelper/1980]
root 270 0.0 0.6 2336 884 ? Ss 09:50 0:00 cron
root 354 0.0 0.5 27496 760 ? Ss 09:51 0:00 vzctl: pts/0
root 355 0.0 1.2 3004 1644 pts/0 Ss 09:51 0:00 \_ -bash
root 367 0.0 0.6 2392 856 pts/0 R+ 09:51 0:00 \_ ps auxf
root@ssd:/# netstat -nl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 2875821005 @/com/ubuntu/upstart
尝试 ssh restart 与 ssh start 均无法启动 ssh 服务:
root@ssd:/# /etc/init.d/ssh restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh restart
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart ssh
ssh stop/pre-start, process 386
root@ssd:/# /etc/init.d/ssh start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start ssh
ssh stop/pre-start, process 399
root@ssd:/# netstat -nl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 2875821005 @/com/ubuntu/upstart
安装 dropbear 在其他端口,并启动,同样无法启动:
root@ssd:~# /etc/init.d/dropbear start
Starting Dropbear SSH server: dropbear.
root@ssd:~# netstat -nl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 2875821005 @/com/ubuntu/upstart
-----------------------------------------------------------------------------------------------------
这个问题多次出现在 OpenVZ 的 ubuntu VPS 中,都是正常使用时,重启系统后 SSH 无法启动,参考帖子:
http://lowendtalk.com/discussion/9076/weird-can-t-start-ssh-service-on-a-openvz-vps始终没有任何办法能解决,最后都是重新安装系统
(但同样的问题从未出现在 KVM / XEN 架构的 VPS,仅出现在 OpenVZ)
如果能帮助我,或者引导我通过查看日志之类的最终能解决问题,我愿意赠送 500XRP 表示感谢
感谢各位! :)
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.