[问题] 无法修改root密码,无法禁止recovery模式下root无密码登录

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
goodluck1982
帖子: 171
注册时间: 2007-07-05 2:48

[问题] 无法修改root密码,无法禁止recovery模式下root无密码登录

#1

帖子 goodluck1982 » 2008-05-06 20:31

[~]$ sudo passwd root
[sudo] password for xxxx:
Enter new UNIX password:
Retype new UNIX password:
passwd:已成功更新密码

这样应该是改好了吧?
可是再次sudo提示输入密码时,输入新密码进入去,输入原来的密码才能进去!
[~]$sudo passwd -l root
密码已更改。
这样应该是锁定root账号了吧?可是仍能sudo su进入root模式
[/]$ sudo su
[sudo] password for xxxx:
Your account has expired; please contact your system administrator
su:User account has expired
(忽略)
bash: syntax: command not found
root@localhost:/#
而且在recovery模式下登录,依然是无密码进入root控制台。

请问如何解决?
头像
goodluck1982
帖子: 171
注册时间: 2007-07-05 2:48

#2

帖子 goodluck1982 » 2008-05-06 22:18

自己顶
reinhardcao
帖子: 116
注册时间: 2007-02-22 1:15

#3

帖子 reinhardcao » 2008-05-07 0:39

加密GRUB就可以了,以下只是简单说明,详细可以查论坛或GOOGLE。


执行 /sbin/grub-md5-crypt
输入密码 确认输入后 会得到一个字符串
saga@Gentoo ~ $ /sbin/grub-md5-crypt
Password:
Retype password:
$1$mE7M2$l7ZxcrEM0hb/80oW9R.xi.

把这个字符串写到 /boot/grub/grub.conf里
格式password --md5 加密后的密码
例如
password --md5 $1$yr9zw1$dQcry7YM2ZWclbvWfTQyF/
头像
goodluck1982
帖子: 171
注册时间: 2007-07-05 2:48

#4

帖子 goodluck1982 » 2008-05-07 20:01

reinhardcao 写了:加密GRUB就可以了,以下只是简单说明,详细可以查论坛或GOOGLE。


执行 /sbin/grub-md5-crypt
输入密码 确认输入后 会得到一个字符串
saga@Gentoo ~ $ /sbin/grub-md5-crypt
Password:
Retype password:
$1$mE7M2$l7ZxcrEM0hb/80oW9R.xi.

把这个字符串写到 /boot/grub/grub.conf里
格式password --md5 加密后的密码
例如
password --md5 $1$yr9zw1$dQcry7YM2ZWclbvWfTQyF/
多谢LS,我知道加密grub可以
我现在只是想知道为什么root的密码改不了以及如何禁止root无密码登录。
回复