找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 13478|回复: 0

linux解决 /dev/null is not a character device! 的问题

[复制链接]
发表于 2013-6-9 12:53:42 | 显示全部楼层 |阅读模式
昨天突然无法 ssh 到云主机,但是可以 ping 通。从控制台上看没有异常,登陆进去后发现 ssh 服务没有启动,企图启动(重启)这个服务时报错 /dev/null is not a character device!:
! l' A# L! H" M% C  e# U. \) G0 {( E( i
# /etc/init.d/ssh restart& |# D+ U- u! \* @3 F
Restarting OpenBSD Secure Shell server: sshd failed!
1 v1 D# r3 |( `/dev/null is not a character device!.) S! \9 m' P1 T& h# b. q' K, n
/ X8 H$ O: q7 l! J1 X3 W5 U
解决办法是,删除 /dev/null 后重建一个字符设备:5 l* M9 w  W5 P' w8 J  z
# rm -f /dev/null  r0 f: ^2 O' T$ P# _' v
# mknod /dev/null c 1 3+ F# b$ g' D; P* x7 W1 T
% i0 l% b2 K* ~6 F
然后启动(重启)ssh 就可以了:9 L9 L2 H/ f! Y" E+ V2 j8 s
# /etc/init.d/ssh restart+ z7 z' O1 Q% x( F% S
Restarting OpenBSD Secure Shell server: sshd.
2 T, \9 \& k' D

1 n3 W. d$ B" L/ t+ O& e  y

" E/ k& B. _8 S4 n
# y/ [) w" e- I2 @( N' |* @
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|第一站论坛 ( 蜀ICP备06004864号-6 )

GMT+8, 2026-11-17 12:38 , Processed in 0.095310 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表