Misbehaving console
I've created a new user on my node using the following commands:
useradd -d /home/newuser -m newuser
passwd newuser
When I now log into my node with this new user using ssh I get a real clunky console. No syntax highlighting, when I press tab it actually tabs instead finding the closed resemblance, the up key for the previous command doesn't work (prints ^[[A). My prompt looks like this "$".
I've checked, and there is a .bashrc in the newly created home folder with a whole bunch of stuff in it.
Is there anyway I can fix my console to be a bit more helpful?
thanks,
Luke
4 Replies
If so, it's most probably either wrong terminal type reported by your SSH client (what is it, btw?), or missing termcap/terminfo database. Well, that or the user's login shell is "true" sh, ash, dash, or other super-primitive shell that does not support line editing.
Try in order:
TERM=vt100
export TERM
and checking if line editor works now
executing "bash" and checking if line editor works there (you may need to install it, tho it's a low chance)
verifying that ncurses, ncurses-base and ncurses-term (or their equivalents on non-Debian; if you have a package described as "terminfo" or "terminfo database" you'll need it too) are installed.
My node is Ubuntu Hardy.
My desktop is Ubuntu Karmic.
When I use ssh (not LISH) with root@mynode it all work fine but with newuser@mynode it looks like, as you said, a very primitive shell.
See, useradd sets the shell to /bin/sh unless specified, and /bin/sh is usually a symlink to the barebones dash, so you gain a few milliseconds per script startup time (and believe me, on a 200 MHz CPU you can see the difference).
On Debian you're supposed to use adduser instead of useradd; there's quite a chance that on Ubuntu too. If not, remember to put -s /bin/bash on your useradd command line next time.