We are too tired of specifying the default shell every time we create a new user. But luckily, there is a file where you can specify the default shell for any new user created. This amazing file is /etc/default/useradd.
Open up the file /etc/default/useradd and look for the following line:
SHELL=/bin/sh
Change it to:
SHELL=/bin/bash
Awesome! Now, any new user created will have /bin/bash as the default shell. Let's test it by creating a new user named spy:
root@ubuntu-linux:~# useradd -m spy
Now, set the password for user spy:
root@ubuntu-linux:~# passwd spy
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Finally, let's switch to user spy and check the default shell:
root@ubuntu-linux:~# su - spy
spy@ubuntu-linux:~$ echo $SHELL
/bin/bash
spy@ubuntu-linux:~$ exit
logout
root@ubuntu-linux:~#
Hooray! We can see that bash is the default shell for user spy.
Keep in mind that /bin/sh and /bin/bash are not the only two valid...