[root@localhost ~]# passwd
-bash: /usr/bin/passwd: Permission denied
[root@localhost ~]# lsattr /usr/bin/passwd
----i----------- /usr/bin/passwd
[root@localhost ~]# chattr -R -i /usr/bin/passwd
[root@localhost ~]# lsattr /usr/bin/passwd
---------------- /usr/bin/passwd
[root@localhost ~]# chmod 755 /usr/bin/passwd
[root@localhost ~]# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
这种方法对于chmod的限制也是可以解除的
本文介绍了解决Linux系统中passwd命令被禁止修改的问题。通过使用chattr和chmod命令,可以成功解除passwd命令的权限限制,恢复正常用户密码更改功能。
1483

被折叠的 条评论
为什么被折叠?



