Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

system: Debian-60-squeeze-64-LAMP 2.6.32-5-amd64

As root I create a user in an ssh-console:

useradd -m -G users myuser
passwd myuser
xxxxxx
xxxxxx

su myuser or after login via ssh I get:

\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]$ \[\033[00m\] plus the cursor

Using the tab key the cursor just jumps forward, so no completion here.

Also the arrow keys do NOT work, if I use right arrow key I get:^[[C

What could cause this behavior?

share|improve this question
1  
Try doing: reset –  jscott Mar 16 '11 at 14:08

3 Answers 3

up vote 1 down vote accepted

useradd uses /etc/default/useradd to select which shell to give a new user. adduser uses /etc/adduser.conf and is usually what you'd want for interactive users as opposed to system-accounts etc.

At least with my installation useradd selects /bin/sh (which links to /bin/dash) as the shell, while adduser selects bash.

chsh /bin/bash myuser

will fix the shell for myuser, switching to adduser instead of useradd will avoid future problems of this kind.

share|improve this answer
    
had to use an '-s' in your command, i.e. chsh -s /bin/bash myuser Thanks a lot for your helpful answer! (added here because I could not find a comment link below your answer, why?) –  hans3092 Jun 23 '11 at 14:37
    
Ah, yes. '-s' is indeed the right thing to do. (I could however not comment about the missing comment-link :-) ) –  olemd Jun 24 '11 at 13:19

Alternatively, append '-s /bin/bash' to your useradd command if you really insist on using useradd instead of adduser.

share|improve this answer

From useradd manpage :

useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead.

Try to re-create the user, but using adduser. I've seen it working much better on different occasions.

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.