Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 1 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 at 22:18
    
thank you that explains it. –  Stpn Jan 18 at 22:30

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.