1. Host name displayed on Ubuntu
Terminal window, you can see the host name in the command prompt, the host name is usually located after the "@" symbol;
Enter the hostname or uname-n command in the terminal window.
2. How do I modify the Ubuntu host name?
By default, Ubuntu login users are user-defined users rather than default root users. You must be the root user to modify the system file.
1) the method for modifying the host name in the root permission environment is as follows:
Enter gedit/etc/hostname in the terminal, as shown in. Modify and save the host name in the pop-up text editor.
2) There are two methods to modify the host name without the root permission:
Switch from a common user to the root user terminal and enter the sudo su command.Then, use the method described above.
Enter the command in the terminal: sudo gedit/etc/hostname
Note: The host name must be restarted after modification.
3 switch from User to root User
Command
Command
4 switch from Root to User
Command
5 difference between su and sudo
After entering the su command on the terminal, the system prompts you to enter the password, which is the password of the root user. Su directly switches the current user to the root user.
Sudo executes commands on the terminal as other users.
6. Set the root user password
Note: After setting the root password, you can still use sudo su to switch to the root user.
7. Disable and enable root users
8. FAQs
1. When you use the su command to switch users, the system prompts that no user * password is displayed. As shown in