It doesn't seem to work for some reason if I do this in /etc/profile:
export SHELL="/bin/bash/"
The chsh $USER
command changes users' shell.
If you want to change them all at once, you can modify the /etc/passwd
file.
You don't want a trailing slash when attempting to execute a binary file.
To set the default shell when you create a new user, it depends how you create new users. For useradd
in Linux (Ubuntu, at least), edit /etc/default/useradd
and change the SHELL
variable.
I'm not sure if it's universal across Linux distros, but in most Unix implementations the file /etc/shells
lists the shells that users can choose from. So if you don't want the users to be able to use chsh
to change to something else, make sure bash
is the only shell listed there.