2

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.

4
  • 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, 2012 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
    – PlutoTX
    Aug 7, 2012 at 16:37
  • Are you (not) using screen, tmux, or a similar tool? What is your $TERM?
    – Daniel Beck
    Aug 8, 2012 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.
    – PlutoTX
    Aug 8, 2012 at 16:24

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .