I want every new user from now on to have bash as their shell by default.
I know that to change your own shell to bash, you would use the command "chsh -s /bin/bash", but how do I automatically set all future users' shell to bash by default?
adduserbashcommand line
I want every new user from now on to have bash as their shell by default.
I know that to change your own shell to bash, you would use the command "chsh -s /bin/bash", but how do I automatically set all future users' shell to bash by default?
Best Answer
adduser
The
adduser
defaults file is/etc/adduser.conf
. The default shell defined by theDSHELL
variable is/bin/bash
by default.useradd
Most likely you don't need this because useradd is a very low-level utility, and it's hardly ever used directly.
If you use useradd, edit the
/etc/default/useradd
skeleton file (don't forget to make a backup though).Set the
SHELL
variable to/bin/bash
instead of/bin/sh
.Now every time you use
useradd
to add a new userbash
is automatically their default shell.Already existing users
If you want to change the shell of already existing users you have to edit the
/etc/passwd
file (please make sure to back have a backup of it).Here is a description of the columns
In that order separated by colons (:) like this.
For more information about that file consult the man page
man 5 passwd
.