How do I set the shell that is used when a user SSHs to a server. For example I can't stand BASH and need to use ZSH, how do I make it so ZSH is loaded along with my profile (.zsh_profile) when I ssh to the machine.

I dont want to have to pass a bunch of parameters with ssh either, can't I set the default shell?

link|improve this question

feedback

migrated from stackoverflow.com Jan 27 '10 at 8:36

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 5 down vote accepted

Assuming you're running on Linux, you can use the chsh command.

chsh -s /bin/ksh foo
chsh -s /bin/bash username
link|improve this answer
Please note that the path to the binary has to be in /etc/shells for the shell to be selectable. – Kimvais Jan 27 '10 at 6:40
feedback

man chsh changes shell, does not always work

Alternatively, you can stick exec /bin/zsh in your bash login script.this will replace bash instance with your shell.

Or you can do ssh host "zsh -l"

link|improve this answer
Why the -1 (15 chars...)? – Noufal Ibrahim Jan 27 '10 at 7:31
feedback

Edit /etc/passwd (if you have the rights, or ask your system admin) to change your default shell.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.