When the Linux system logs in to the new user, the shell starts to $, does not display a solution for username and path.

Description: In the Linux system, after using the useeradd command to create new users, when logging in to the user, the shell starts to $, does not display the username and path, as follows:


Workaround: After viewing the / etc / passwd file, found that the newly created user does not specify the shell.We only need to specify it as / bin / bash.

Switch to root users Use usermod command to modify shell Type $ SUOT @ VM-202-164-Ubuntu: / app # usermod -s / bin / bash duroot @ VM-202-164-Ubuntu: / app #

Successfully solved!

If you have not been resolved, try the following measures (taken from other people’s methods, no test success):

Add the following code to ~ / .bash_profile, if there is no file, you can create it yourself: vi ~ / .bash_profile # Add #EXPORT PS1 = ‘[u @ h w] $’ saving makes the variable take effect: SOURCE ~ / .BASH_PROFILELog in

Related Posts