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?



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
  • Thanks, in fact changing shell to zsh and regenerating configs helped. – firedev Mar 3 '15 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 '15 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 '15 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.