Pages

Monday, June 2, 2014

How to Fix "Arrow keys, tab-complete not working" on Unbuntu Terminal Shell

I have installed ubuntu minimal(mini.iso) on my vm. I then used recovery mode to login as root and create an account with useradd -m admin and then set a password with passwd admin.
When I login on the new account, instead of the normal prompt I only see a $ sign. If I try to tab-complete a command or file name it prints a normal tab. If I try to use the arrow keys it prints ^[[A^[[B^[[C or ^[[D. Also, ls no longer adds colors.
None of these problems were in recovery mode. How can I fix this?
That probably means that the new user account was created with /bin/sh as its login shell (which symlinks to the dash shell by default) instead of /bin/bash - you can change a user's login shell with the 'chsh' command
sudo chsh -s /bin/bash <username>
(you will need to log out and back in for the change to take effect). You may also need to copy the default .bashrc from /etc/skel to get the color prompt.
In future you might want to use the 'adduser' command instead of 'useradd' - it sets up a more complete user environment including things like a default .profile and .bashrc - as well as setting the login shell to 'bash' 

No comments:

Post a Comment