|
昨天突然无法 ssh 到云主机,但是可以 ping 通。从控制台上看没有异常,登陆进去后发现 ssh 服务没有启动,企图启动(重启)这个服务时报错 /dev/null is not a character device!:7 t" _( k, K" z# [
@* ^' q8 R% b8 f* r# /etc/init.d/ssh restart
' k4 U4 E/ ~+ e, uRestarting OpenBSD Secure Shell server: sshd failed!
* Y5 \: a$ z0 I) _/dev/null is not a character device!.
3 e' Y/ _, q+ Z3 E x- ?
R# W8 p/ P2 } S& P解决办法是,删除 /dev/null 后重建一个字符设备:
5 P. `- D- }' L2 \' r* r5 U" Q# rm -f /dev/null
" Q) J4 ?% P" v5 J8 ?% l4 E) l5 h# mknod /dev/null c 1 33 E% b& Z E% x; l2 R5 V' ~- t
. ]5 ?( R) R. W0 c" _
然后启动(重启)ssh 就可以了:* Q1 X R5 Q0 N1 _/ Y
# /etc/init.d/ssh restart9 H# F \) a8 @8 o* [
Restarting OpenBSD Secure Shell server: sshd.9 L R& W3 Z4 U
; `9 T! C' z) `1 C# I, d6 T5 `, ~" O
1 P6 d/ M3 l' U. _6 d+ D
6 u4 x! \" |& J |
|