找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 12274|回复: 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!:
5 ~0 l9 b: {$ V% V( t- c% S! x/ g1 k( q. M) h3 u6 {9 p% A) g
# /etc/init.d/ssh restart9 m. q! b! l. d" Q, o
Restarting OpenBSD Secure Shell server: sshd failed!
) c8 a4 ^3 I/ h/dev/null is not a character device!.+ E5 X! R* t1 ?5 R. ^

' I, i) g% y* j# D4 f# W解决办法是,删除 /dev/null 后重建一个字符设备:
" e! Q# [, i3 n) o$ x3 v! c1 o# rm -f /dev/null
7 d1 ?2 i5 U& n+ o  `# mknod /dev/null c 1 3- L2 J1 Q7 i% N: }1 n1 z
) \, g  V$ E, A: C
然后启动(重启)ssh 就可以了:
* K1 S, B' V2 h' n" R: p* V0 d# /etc/init.d/ssh restart3 b. T' P  {+ d2 F
Restarting OpenBSD Secure Shell server: sshd.
( u( w4 y; [. K! I' a2 r5 H

6 u3 o' Z2 N" G. w7 v. K5 ?

( s* n. p, Z( L) ]
! ?- Z5 l" ^+ u
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-5-25 11:09 , Processed in 0.042635 second(s), 24 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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