New users under Ubuntu do not display the user name and directory file path

Problem description: The company's ubuntu compilation server. After the new user successfully connects using the ssh terminal, the user name is not displayed. Manually mkdir a new directory, and then cd into the new directory. The user name and new directory are not displayed. Use the pwd command to output /home/ new_user/new_dir, indicating that there is no problem with the user directory, but it is not displayed correctly.

Problem Solved: I guessed it was related to the configuration. I asked my colleague if there was any problem with his account. He was also a new user. He said no, which made me very depressed. Then..., then I hurried to Baidu and watched it for a while. It said that I needed to switch to root, use usermod to modify the shell type of the new user, switch to root, and I had to find the leader, which was troublesome. I still feel inspired, and I can make enough food and clothing by myself. My colleague said that there is a hidden .bashrc file in the user's root directory. I quickly took a look under my own directory, wow, there is no .bashrc file.

Key point: Copy the .bashrc file in your colleague's directory to your own user root directory, enter the command source .bashrc, calm down, and KO. 

Summary: The idea is very important. Through the problems and solutions, you can find similar problems, which should be the problem of the user shell. Other Linux environments are not necessarily called .bashrc files. Just find the file with the same function, and then don’t forget to source it. There are configurations of relevant environment variables in the shell file.

Guess you like

Origin blog.csdn.net/qq_25335547/article/details/121670194