3

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!

AturSams
  • 225

1 Answers1

6

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
Terrance
  • 43,712