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 just created a new user on my system using useradd -d /home/users/john -m john (Using Ubuntu 11.04). This worked fine, but when I changed to john, my bash is not fully functional. That is, it has no autocomplete, I can not use they arrow keys (e.g. UP to get the last command), and instead of showing my current directory it only shows $. I loaded a .bashrc but this appears to be completely ignored. What could cause this?

PD: this user is already working on the system and I rather not remove it and add it again, if possible.

share|improve this question
    
Define what you mean by "when I changed to john". Did you log in with that user at the main console, on a pty, through ssh, or did you su or su -? –  Paul Tomblin Nov 27 '11 at 19:36
    
What are the permissions/ownership on the .bashrc you loaded? –  Paul Tomblin Nov 27 '11 at 19:37
add comment

2 Answers

up vote 11 down vote accepted

Probably john's shell is not /bin/bash, but /bin/sh. On Ubuntu, that's a shell intended to execute scripts fast, with no fancy interactive features such as command line edition. Check last column of grep john /etc/passwd or getent passwd john. You might want to run chsh -s /bin/bash john to change user's shell.

share|improve this answer
1  
Excellent, that was indeed the case! –  user11780 Nov 27 '11 at 20:03
1  
Just a note. In Ubuntu /bin/sh is symbolic link to dash i.e. /bin/dash, so ultimately user's shell is /bin/dash. –  Sachin Divekar Nov 27 '11 at 20:52
add comment

you can jump between shells by typing the name of the shell

$ bash

and in the next line you will get this following prompt

user@hostname$ 

which is the bash shell. Your up arrow key and autocomplete will work now

share|improve this answer
    
It should be noted that is obviously temporary. The currently accepted answer has a more permanent solution. –  jw013 Nov 7 '12 at 14:30
    
ok I didnt know that, thanks for that I will save the accepted answer for future reference –  Saad Nov 8 '12 at 6:28
add comment

Your Answer

 
discard

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