Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using a Ubuntu server via ssh. Everything is fine under root but if I create and login into the users I create, the navigation keys became ^[[A ^[[B etc. And the original functions such as previous command is gone. I don't know where I go wrong.

share|improve this question
    
What function like "previous command" do you mean? Does root have a special shell configuration file that would define anything like this? –  slhck Aug 6 '12 at 14:16
    
@slhck I haven't set any thing yet, normally in command line interface I can obtain my previous command by pressing "up", in this case i got ^[[A instead –  Sheep Aug 7 '12 at 16:37
    
Are you (not) using screen, tmux, or a similar tool? What is your $TERM? –  Daniel Beck Aug 8 '12 at 16:08
    
@DanielBeck I'm not using any screen split tool, and there is no problem under root, the user is created by useradd using default configuration. –  Sheep Aug 8 '12 at 16:24
add comment

1 Answer 1

up vote 1 down vote accepted

It sounds like you are not setting your created user's shell to bash. If you do not set this explicitly, the system uses the default (see /etc/default/useradd). Try adding this option to your useradd command:

-s /bin/sh

I also recommend creating a file in your home directory called .inputrc with the following lines:

"\e[A": history-search-backward
"\e[B": history-search-forward

This makes the Up button search only for those commands that start with whatever you have typed. So, if you type "sudo" and hit up only those commands starting with sudo will be shown.

share|improve this answer
add comment

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.