Thursday, July 28, 2016

Changing Shells on a Domain

Problem:  Linux box on Windows domain does not allow the user to set the shell with chsh -s /bin/zsh (or whichever shell).  There are no errors, it just doesn't work.  Using root, nothing happens either, using chsh -s /bin/zsh to set it for the user gives the error user '' does not exist in /etc/passwd.  You could probably go into the passwd file and make it work but a suitable way is to add to .bashrc

export SHELL=/bin/zsh
exec /bin/zsh -l

This redirects the shell to zsh but also allows you to type "exit" to leave the terminal - not just return to bash.

*NOTE:  this should also work if the user does not have root access - like on a shared computer

No comments: