Friday, May 3, 2024
275
rated 0 times [  275] [ 0]  / answers: 1 / hits: 209171  / 2 Years ago, mon, november 14, 2022, 11:42:02

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?


More From » command-line

 Answers
3

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


chsh -s /bin/bash

or to change another user's login shell (need to be root to do this obviously)


sudo chsh -s /bin/bash <username>

(you will need to start a new login session for the change to take effect). You may also need to copy the default .bashrc from /etc/skel to get things like the color prompt and default LS_COLORS.


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'


[#30165] Monday, November 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nguai

Total Points: 216
Total Questions: 108
Total Answers: 116

Location: Hong Kong
Member since Thu, Dec 16, 2021
2 Years ago
;