Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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 7 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
share|improve this answer
1  
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
add comment

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"

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

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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