I've given an Ubuntu 18.04 box with user account which have root permission but not use /bin/bash as default shell.
Hence, when I ssh to it, when I hit left, right, up, down ←↑→ keys, it will produces ^[[D ^[[A ^[[C
I want to change the user to default use /bin/bash shell with
sudo chsh -s /bin/bash {MY_USERNAME}
but the terminal says:
chsh: /etc/passwd.20598: Permission denied
chsh: cannot lock /etc/passwd; try again later
How could I fix it?
/bin/bash– vidarlo Aug 25 '21 at 16:52lsof /etc/passwdto see which process(es) that have /etc/passwd open - if any. – Soren A Aug 25 '21 at 16:58/etc/passwd. But since the file is locked, it means that someone is editing it. (Or someone has started an editor and have that file open but probably forgot about it.) There's nothing you can do... Well...you could uselsofas suggested above and terminate the process that's editing it...but you really, really shouldn't do that. A "fight" between system administrators is the last thing any system needs. Try to find out who has it locked and talk to that person...lsofshould tell you what program and the user that has it open – Ray Aug 28 '21 at 13:09