change shell of a user from /bin/false to another

3

2

I made a mistake of change the root shell to /bin/false, but when I want to change it back, I always got error

sudo chsh -s /bin/bash root
[sudo] password: <input current user password>
password: <input root password>
chsh: PAM: Authentication failure

guilin 桂林

Posted 2014-06-24T09:18:31.740

Reputation: 311

...the easiest thing to do would be to boot off a livecd. Or try single user mode. – Bob – 2014-06-24T09:21:47.720

Answers

5

You can modify the file /etc/passwd if chsh doesn't work, by replacing the line

root:x:0:0:root:/root:/bin/false

with

root:x:0:0:root:/root:/bin/bash

xuhdev

Posted 2014-06-24T09:18:31.740

Reputation: 1 399

for editing /etc/passwd (which should indeed work) one must be root (or use sudo...). A livecd may work if the /-filesystem can be mounted. – trurl – 2014-06-24T09:32:09.040

0

Try:

sudo vigr

In the editor, change root's shell back to /bin/bash (It should be the last field on the first line)

AlexKing

Posted 2014-06-24T09:18:31.740

Reputation: 66