Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am not even sure how to ask this properly..

I am using EC2 Ubuntu 12.04 I added a new user

 sudo useradd -g admin admin
 sudo adduser admin sudo

Changed shudders so I can use new user without password then did this:

sudo useradd -g admin admin
sudo adduser admin sudo
sudo su admin
cd ~
sudo mkdir .ssh
sudo cp /home/ubuntu/.ssh/authorized_keys /home/admin/.ssh
sudo chown admin:admin /home/admin/.ssh/authorized_keys 

Now when I ssh in as admin I get strange terminal behavior:

1) I can't ls

2) Pressing arrow up results in ^[[A

How can I fix it and why it happened??

Thank you.

share|improve this question
up vote 4 down vote accepted

That is because you used useradd instead off adduser to make the new user. On Ubuntu by default useradd sets the user's default shell to /bin/sh (dash), while adduser sets it to /bin/bash. And /bin/sh doesn't have readline support, hence the unexpected behaviour with the up arrow.

You just have to switch to bash by typing in bash.

To change the new user's default shell to bash use:

chsh -s /bin/bash

while logged in as the new user (admin).

share|improve this answer
At least for the up arrow behaviour. Why you can't ls? I now have no clue. – falconer Jan 18 '14 at 22:18
thank you that explains it. – Stpn Jan 18 '14 at 22:30
I ended up deleting the user I just created. The process was useradd newuser, userdel newuser, adduser newuser while logged in as root. Just in case anyone needs a quick fix. – Krøllebølle Apr 12 '15 at 15:52

Your Answer


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.