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.

This question already has an answer here:

I have a Ubuntu Server VPS and I want to use /bin/bash/ as my shell. How can I change my shell? I have root access but I don't work as root. So dash is my default shell now.

I have read How do I make Bash my default shell on Ubuntu? and chsh seams to be the preferred way to go. But when I type chsh /bin/bash I get this message: chsh: unknown user /bin/bash

And if I just type /bin/bash the Bash shell seams to work fine. How to change it?

share|improve this question
add comment

marked as duplicate by Heptite, Garrett, random Mar 8 at 13:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3 Answers

up vote 32 down vote accepted

To change a shell, use the bare chsh command. This will prompt you for the new shell. You do not have to run anything as root.

share|improve this answer
    
Ah, that was even better! –  Jonas Mar 12 '10 at 20:19
4  
don't forget to log out and log back in to see the change. –  seafangs Jul 3 '13 at 12:23
add comment

When running as root, you can use chsh to change other users shells. The syntax you want to use it this. You can change your own shell without root rights.

chsh -s /bin/bash username

share|improve this answer
    
Thanks a lot! That works fine! –  Jonas Mar 12 '10 at 15:22
6  
-1 chsh does not need to be run as root to change your own shell. Changing others' shells requires root. –  Broam Mar 12 '10 at 17:25
add comment

You can change your default shell for your user by using the usermod command.

sudo usermod -s <shell> <username>

replace with the name of the shell you want to use (i.e. /bin/bash) and with the username for which you want to change it.

This will set the default shell for the username selected in the /etc/passwd file.

share|improve this answer
add comment

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