|
|
昨天突然无法 ssh 到云主机,但是可以 ping 通。从控制台上看没有异常,登陆进去后发现 ssh 服务没有启动,企图启动(重启)这个服务时报错 /dev/null is not a character device!:
" V9 v! V; [- w0 q0 U! N/ v9 w, I
# c5 m1 z- Q& Q, N9 a2 d3 L# /etc/init.d/ssh restart
2 c) K+ x; Q/ X( b+ F, t, ~7 Y9 @1 kRestarting OpenBSD Secure Shell server: sshd failed!
" s3 T( h8 m8 g/ ?, F/dev/null is not a character device!.
' W& o+ }& g5 w D
1 q6 A, Y3 x: z% n& [解决办法是,删除 /dev/null 后重建一个字符设备:% [' m# U Y3 o- y. n2 ` G* z
# rm -f /dev/null
4 t& S8 _. J# r. g) e w3 D# mknod /dev/null c 1 3% A [4 [% J, e7 s6 `& I0 o6 l; a/ o
' n# M6 m; O" x! F y+ Z( X然后启动(重启)ssh 就可以了:1 W# \% n/ h' A" @
# /etc/init.d/ssh restart# z: E8 j6 \! w. }
Restarting OpenBSD Secure Shell server: sshd.% h3 S; D x [# k% u, F
' ~) U( `- B$ [( E4 t Q! G- u/ G/ u
z) \! q- c: z) }, |
9 X! j4 H/ Z3 c# U7 f |
|