免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1759 | 回复: 2
打印 上一主题 下一主题

求助--根用户帐号登录 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-13 14:43 |只看该作者 |倒序浏览
昨天,我以root账号编辑了.bashrc文件,机器重启以后就不能以root账号登录了。
输入根用户名和密码后,会出现如下信息:
your session only lasted less than 10 seconds. If you have not looged out yourself, this could mean that there is some installation problem or that you may be out of diskspace. Try logging in with one of the failsafe sessions to see if you can fix this problem.并给出了详细的错误信息,如下:
-/bin/bash:line 16:bash:command not found
-/bin/bash:line 1:id:command not found
-/bin/bash:line 1:id:command not found
-/bin/bash:line 1:id:command not found
-/bin/bash:line 12:[:too many arguments
-/bin/bash:line 16:[:too many arguments
/bin/bash:line 1:id:command not found
/bin/bash:line 1:id:command not found
/bin/bash:line 1:id:command not found
/bin/bash:line 12:[:too many arguments
/bin/bash:line 16:[:too many argumentsents
/root/.Xclients:line 8:/root/.Xclients-default:No such file or directory
/root/.Xclients:line 8:exe:/root/.Xclients-default:cannot execute:No such file or directory
幸运的是一般用户账号能登录,但mv, tar, rpm等重要命令失效。
以一般账号进入系统,运行su命令,输入root账号密码后,会出现如下错误:bash:bash:command not found。但[ ]里的账号会改为根用户账号,提示符也会由$变为#,可是当前用户所在的目录仍为以一般用户登录时的目录,即[root@localhost yjy]#。键入除cd外的任何命令都无效,会出现如下错误信息:command not found.
另外。我还试着在文字模式下以root账号登录,结果同样是失败。输入root账号和密码后,显示如下内容:
Last login:Wed Sep 13 08:59:39 on :0
You have new mail
-bash:bash:command not found
[root@localhost root]#
请教各位,除了重装系统还有其他解决方法吗?谢谢!!
对了,我的linux为red hat 9.0, 内核为2.4.20-8。

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
2 [报告]
发表于 2006-09-13 15:04 |只看该作者
把/etc/skel下所有文件cp到root的主目录里试试看
cp -f /etc/skel/.* /root

论坛徽章:
0
3 [报告]
发表于 2006-09-14 09:56 |只看该作者
谢谢  寂寞烈火 (逗逗她爹&reg  的回复。
我以一般用户账号进入LINUX并键入你所给的命令(cp –f /etc/skel/.* /root)后, 根用户账号仍然不能登录,系统错误也没有恢复。
键入cp –f /etc/skel/.* /root后,会显示如下信息:
cp: omitting directory ‘/etc/skel/.’
cp: omitting directory ‘/etc/skel/..’
cp: cannot stat ‘/root/.bash_logoput’: permission denied
cp: cannot stat ‘/root/.bash_profile’: permission denied
cp: cannot stat ‘/root/.bashrc’: permission denied
cp: cannot stat ‘/root/.canna’: permission denied
cp: cannot stat ‘/root/.emacs’: permission denied
cp: cannot stat ‘/root/.gtkrc’: permission denied
cp: omitting directory ‘/etc/skel/.kde’
cp: omitting directory ‘/etc/skel/.xemacs’
cp: cannot stat ‘/root/.zshrc’: permission denied

对了,我对.bashrc文件编辑的内容如下:
export PATH=$PATH:/home/yjy/usr/java/j2sdk1.4.2_12/bin
.bash
当时没事,可重新启动机器后根用户就不能登录了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP