Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have never had to deal much with BASH setup under Debian Linux, but this time, somebody has given me a server that acts weird.

When I log on as root, everything works as I am used to: I see a normal prompt telling me who/where I am, pressing the UP key displays previously typed commands, etc.

But when I log on as a created user, the prompt is "$", the UP key displays the characters ^[[A and when I try to change the prompt by typing PS1="\u@\h:\w\$ " the prompt literally becomes \u@\h:\w\$ - i.e. \u is not replaced by user name, etc.

Looking at the etc/profile and the etc/bash.bashrc files does not give me any clues. And I have I tried Google'ing to no avail.

Can anybody point me in the right direction? A step-by-step guide to which files to look at and what they should could be helpful. Another approach could be to reset a user's bash settings (without having to delete and restore the user).

share|improve this question

migrated from stackoverflow.com Oct 3 '11 at 14:55

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

1  
The user's login shell is apparently /bin/sh, or at least not Bash. Try man chsh or as a quick workaround exec /bin/bash -login. –  tripleee Oct 3 '11 at 14:43

2 Answers 2

up vote 3 down vote accepted

Type finger username ... it's likely the system has a different default shell. If the shell line doesn't say /bin/bash you can change it with

usermod -s /bin/bash username

EDIT: forgot to mention, if the user is logged in. Log them out and back in after you do that command.

share|improve this answer
    
Very basic, I know, but nevertheless exactly what I was looking for. Thanks! –  W3Coder Oct 3 '11 at 15:25

There are several file you can check, after /etc/profile (it does some includes at the end too), /etc/bash.bashrc

  • /etc/bashrc
  • ~/.profile
  • ~/.bash_profile
  • ~/.bashrc

The order in which this files are read (if the exist) is specified in the bash manpage in the section INVOCATION.

share|improve this answer

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.