|
|
昨天突然无法 ssh 到云主机,但是可以 ping 通。从控制台上看没有异常,登陆进去后发现 ssh 服务没有启动,企图启动(重启)这个服务时报错 /dev/null is not a character device!:
( ]1 ]6 `5 p9 z/ t8 ~ \' r: S) g! u7 B# u7 ]
# /etc/init.d/ssh restart, e8 h, Q- t% x- p, `2 Q
Restarting OpenBSD Secure Shell server: sshd failed!$ R4 S6 H3 U a- w4 I
/dev/null is not a character device!.) U! H [6 x; F; x( j5 k
" x# J0 ~& `; ]% z7 U+ h" ^2 E解决办法是,删除 /dev/null 后重建一个字符设备:
8 d9 ]/ F% n/ w) |! v$ W# rm -f /dev/null# Y5 D. u! W+ u% |4 t1 q, K4 d
# mknod /dev/null c 1 3
7 p |6 _, J4 e' U8 m2 G9 Z) l6 D7 c5 t9 V1 V, Q" U
然后启动(重启)ssh 就可以了:, d: W/ b8 N L I: x
# /etc/init.d/ssh restart( q: o+ c$ E* J+ v1 q
Restarting OpenBSD Secure Shell server: sshd.
, }7 y; C, n& u9 u* c5 M
, b) q" ^+ Y4 }, `% P# i' Y j! ^4 s
# Q9 ~& o% z+ {. N |
|