One may:
sudo chsh -s /bin/sh
or
sudo chsh -s /bin/sh user_name
It is understood that the second command changes the shell for the specified user_name but unclear what happens without specifying a user_name and where is that reflected?
Thank you!
The command without a user changes the root user:
terrance@terrance-ubuntu:~$ sudo chsh -s /bin/sh
terrance@terrance-ubuntu:~$ cat /etc/passwd | grep "/bin/sh"
root:x:0:0:root:/root:/bin/sh
terrance@terrance-ubuntu:~$ sudo chsh -s /bin/bash
terrance@terrance-ubuntu:~$ cat /etc/passwd | grep "/bin/bash"
root:x:0:0:root:/root:/bin/bash
sudo chsh -s /bin/bash root? – AturSams Jan 17 '23 at 08:12sudois a bad idea: normal users are limited to shells listed in/etc/shells, so users cannot accidentally lock themselves out by switching to something that isn't a working shell. As root, you can set anything, including something that doesn't work. – Simon Richter Jan 17 '23 at 13:36sudo chshchanges the shell for root is thatsudoswitches to root, andchshchanges the shell of the current user. – Simon Richter Jan 17 '23 at 13:37chshwithoutsudowould change the user's own shell. I'm kind of disappointed that on too many linux systems,chshwithoutsudoyields an error. – Joshua Jan 17 '23 at 19:32