4

That should be something obvious, but I can't seem to find a way to fix it.

I am using iTerm and logging in to Ubuntu server remotely.

This is what I see when I press arrows:

$ ^[[A^[[B^[[C^[[D

User was added via useradd so the home folder is empty. How can I fix arrows?

Thanks

1 Answer 1

4

Those arrow keys work if you use an appropriate shell like bash.

The $ is a a clear indicator you are not using one of them (otherwise you would, by default, see more than just a $ as a prompt).

You should have done something like this:

useradd -u {username} -d /home/{username} -s /bin/bash -p {password}

You do not have to recreate the user though; Afterwards you can change the shell (permanently) when logged into the user:

chsh -s /bin/bash
3
  • Thanks, in fact changing shell to zsh and regenerating configs helped.
    – firedev
    Mar 3, 2015 at 9:50
  • 1
    When I have been creating users on Ubuntu, it has always been defaulting to use bash. Is that because I used adduser rather than useradd?
    – kasperd
    Mar 3, 2015 at 11:18
  • @kasperd yes. adduser is a script that sets defaults and then calls useradd. See the link I added: "... by default choosing Debian policy conformant UID and GID values, creating a home directory with skeletal configuration." One of those is setting bash as a shell.
    – Rinzwind
    Mar 3, 2015 at 12:22

You must log in to answer this question.

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