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.
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
).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments