Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When logging in as root at my server everything works fine, but when I log in as myusername the bash is not working correctly.

The line starts with:


instead of


and all specials keys like the arrow keys, tab keys, etc. won't work.

When I type bin/bash it works again, but I'd like to fix the problem or auto run bin/bash on login. How can I fix this?

share|improve this question

migrated from serverfault.com Oct 8 '12 at 18:49

This question came from our site for system and network administrators.

up vote 6 down vote accepted

You just need to change your shell. As that user, run:

$ chsh -s /bin/bash

Then sign out and back in.

After doing this the prompt doesn't look like you want, you'll need to start tweaking your environment's PS1 variable.

share|improve this answer
that did it, thanks! – askmike Sep 7 '12 at 12:06
This is actually kind of dangerous since the question is asking about the root user. He's likely not using Linux. Root should stay with the default shell since the vendor is probably going to count on it being ksh or whatever else they chose. Instead, the real answer is "you shouldn't be logging in as root anyway". – bahamat Oct 8 '12 at 22:22

One possible reason is that the default shell of myusername is not bash.

You can check the shell of your current user with:

  • echo ${SHELL}
  • echo $0

To change the user shell permanently see man chsh , e.g.:

chsh -s /bin/bash
share|improve this answer

You need to change your shell. Run the command

chsh -s /bin/bash

then sign in again.

However, not all users have the right to change their own shell. If you use sudo remember to add your username to the chsh command as

sudo chsh <username> -s /bin/bash

otherwise you will change the shell for root inadvertently.

share|improve this answer
Fair point. Extended the answer slightly. – Mikael Fremling May 13 '14 at 13:00
This should be the accepted answer. – aks. Jul 5 at 14:34

Your Answer


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