永远都不要修改root的shell..

| 3 Comments | No TrackBacks

有几个月没有去碰freebsd的东西了,今天想趁空闲给某台机器做个升级。用portupgrade升级时出了些问题,结果bash被卸载了。当我发现这个问题的时候网络连接正好也中断了……于是root被锁在了屋外Innocent

多年前出过类似的错误,没想到这次又是——不知道出于什么原因,这台机器的root默认shell竟然是bash。这样就造成无法su或者直接登录成root。

2种解决办法,一种是如果普通用户可以登录,并且允许su,那么执行"su -m",这样做可以使成为root的时候继续使用当前用户的shell及其他的一系列环境变量。另外一种解决办法是需要能sftp或者ftp方式访问到/bin,将/bin下面的sh或者csh复制到bash对应的目录,直接覆盖即可,让sh或者csh临时"当作"bash以便用户能凑合登录进去。

永远都不要用外带的shell,永远都不要修改root的默认shell……

No TrackBacks

TrackBack URL: http://www.liukang.com/cgi-bin/mt/mt-tb.cgi/627

3 Comments

貌似 su - 是使用 root 的环境变量啥的?
我确实记错了,应该是"su -m" :-) 多谢提醒
试试看toor? :-)

Leave a comment

Google ADs

ClustrMaps

Archives

Pages

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.37
Creative Commons License
This blog is licensed under a Creative Commons License.

January 2012

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

About this Entry

This page contains a single entry by Kang published on October 7, 2007 10:29 PM.

今天参加了法培 was the previous entry in this blog.

今天通过了交通法规考试 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Google ADs