您的位置:首页 > 运维架构

useradd: unable to open password file 解决办法

2010-11-09 17:12 295 查看
useradd: unable to open password file 解决办法
2010-03-24 23:51

现象:

root用户用useradd加个普通用户提示:useradd: unable to open password file。

普通用户su root提示:密码错(我可以肯定密码是对了)。

解决办法:

1.首先检查下面四个文件是否加了权限保护

[root@203 etc]# lsattr /etc/passwd

------------- /etc/passwd

[root@203 etc]# lsattr /etc/shadow

----i-------- /etc/shadow

[root@203 etc]# lsattr /etc/gshadow

------------- /etc/gshadow

[root@203 etc]# lsattr /etc/group

----i-------- /etc/group

从结果来看/etc/shadow 和 /etc/group都加了保护。下一步就是去除保护

2.删除文件保护

[root@203 etc]# chattr -i /etc/shadow

[root@203 etc]# lsattr /etc/shadow

------------- /etc/shadow

[root@203 etc]# chattr -i /etc/group

[root@203 etc]# lsattr /etc/group

------------- /etc/group

3.添加用户试试

[root@203 etc]# useradd huangf

[root@203 etc]# passwd huangf

Changing password for user huangf.

New UNIX password:

BAD PASSWORD: it is too simplistic/systematic

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

添加用户成功了!!!!!

转自:http://hi.baidu.com/fei_20018/blog/item/e4c754f6cf728529bd3109ee.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐