Problem description: In the Linux system, after using the useradd command to create a new user, when logging in to the user, the shell starts with $, and the user name and path are not displayed, as follows:
$ $ $
Solution: After viewing the /etc/passwd file, it is found that the newly created user does not specify a shell. We just need to specify it as /bin/bash.
- Switch to root user
- Use the usermod command to modify the shell type
$su $ root@VM-202-164-ubuntu:/app# usermod -s /bin/bash du root@VM-202-164-ubuntu:/app#
Successfully solved!
If it is not resolved, please try the following methods (excerpted from other people's methods, failed to try):
- Add the following code to ~/.bash_profile, if there is no such file, you can create it yourself:
you ~ / .bash_profile #join in #export PS1='[u@h W]$' #keep
- Make the variable take effect:
source ~/.bash_profile
- re-register