Depends on what you are using to add users. If it's the adduser
command, then edit your /etc/adduser.conf
file -- there you will find the default login shell option, namely: DSHELL
.
If, on the other hand, you prefer to use useradd
then use it with the -s <shell of choice>
parameter.
If you wish to change the shell of existing users you can simply edit /etc/passwd
and change it there. sed
is a perfect choice in case you need to apply changes to numerous lines. Run sed 's/bash$/zsh/g' /etc/passwd
and see what it does. You should see the contents of your /etc/passwd
with every bash
replaced by zsh
. If you are satisfied with the result you can run the same command with -i option: sed -i 's/bash$/zsh/g' /etc/passwd
. Don't forget to make a copy of the original file, just in case :)
useradd
to beuseradd -s /bin/zsh
:)