Misbehaving console

Hi,

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

Just to verify, "using ssh" as in ssh youruser@yournode, not through the LISH's ssh access via ssh linodeXXXXX@cityXX.linode.com ?

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.

OK, sorry, I'll add some missing information.

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.

Then run chsh as that user, or chsh as root, and set it to /bin/bash (or your preferred other shell, if installed).

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.

Ah, you see. I knew there had to be a difference between useradd and adduser. At least now I found one of them. Thanks!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct