找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 13458|回复: 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!:, w) `0 T! s, y& [+ D7 ^
2 q: s2 j: i) H2 i
# /etc/init.d/ssh restart/ u) }. Y9 w" C  K6 e3 a# a# M
Restarting OpenBSD Secure Shell server: sshd failed!
" N: L) M1 L2 K/dev/null is not a character device!.+ I! n" R6 ^/ b$ @7 D9 E' H5 T6 c
2 }9 w% ]- w8 L, f  o4 E  \0 [
解决办法是,删除 /dev/null 后重建一个字符设备:$ D8 J7 b5 ^) e/ e! L
# rm -f /dev/null! `& J8 Q7 L6 `8 d9 x+ G
# mknod /dev/null c 1 35 U# Q- s7 b5 L4 F8 C: e

& H( w' J: v7 e0 V
然后启动(重启)ssh 就可以了:5 {& M7 j: v4 i* n  ?8 r: {
# /etc/init.d/ssh restart5 ]7 p& W; Q( e
Restarting OpenBSD Secure Shell server: sshd.2 [1 p) o! |$ }( C
' ~/ _/ @; l1 [7 |3 N

, m) J/ g  U" h$ u: x  m. y+ B5 X; s3 Y# `1 g
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-11-12 05:55 , Processed in 0.106656 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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