将用户的 shell 从 /bin/false 更改为另一个

gui*_* 桂林 4 linux user-accounts shell ubuntu

我把root shell改成/bin/false 搞错了,但是当我想改回来的时候,总是报错

sudo chsh -s /bin/bash root
[sudo] password: <input current user password>
password: <input root password>
chsh: PAM: Authentication failure
Run Code Online (Sandbox Code Playgroud)

xuh*_*dev 6

/etc/passwd如果 chsh 不起作用,您可以通过替换该行来修改该文件

root:x:0:0:root:/root:/bin/false
Run Code Online (Sandbox Code Playgroud)

root:x:0:0:root:/root:/bin/bash
Run Code Online (Sandbox Code Playgroud)