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?

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

3 Answers

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.

link|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
feedback

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

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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