Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to change my shell from the default bash shell to zsh on my Amazon EC2 instances. How do I go about doing it? Thanks!

share|improve this question
add comment

1 Answer 1

up vote 74 down vote accepted

Try using the chsh command.

e.g.

chsh -s /bin/zsh

You can confirm the location of zsh by running whereis zsh, or alternatively simply run

chsh -s $(which zsh)

If you want to change the shell for a user account other than the one you're logged into, you'll need to run it as root, so to change john's shell, do:

sudo chsh -s $(which zsh) john

Note that you'll need to log out and log back in for the change to go into effect. If you're using Gnome or some other window manager, you'll need to completely log out of that session as well—simply closing and opening your terminal is insufficient.

share|improve this answer
    
I did try that, but with the root user!! My AMI Image has ubuntu rather than root. Had to switch to ubuntu user to change the shell! Thanks for the hint :) –  Paddy Jan 11 '11 at 11:45
    
@Paddy if you are root you can change it for another user by running chsh -s /bin/zsh username. –  John T Jan 11 '11 at 11:47
    
Awesome :) Much easier. Thanks for that info too. –  Paddy Jan 11 '11 at 11:48
    
I'm getting: chsh: /usr/local/bin/zsh is an invalid shell –  Pineapple Under the Sea Feb 26 '13 at 4:13
1  
@We are the World: You need to add /usr/local/bin/zsh as a new line to /etc/shells –  Nate Parsons Jun 4 '13 at 17:54
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.