How to change the LINUX user name? Is it not ROOT?
You cannot change your username if you are not a root user, you can only use root to change it. Methods for root user modification:
1. Directly modify the /etc/passwd file and change the user name part of /etc/shadow.
2. You can use the command: usermod-l to modify the user name. If the root user name cannot be modified, delete the root user, and then use sudo to make certain specific Users can perform operations that can only be performed by root (for example, ubuntu uses this mechanism)
Linux changes the directory name?
Linux uses the mv command to modify the directory name
Command format: mv source file or directory target file or directory
The mv command is the abbreviation of move and can be used To move files or rename files (move(rename)files), it is a commonly used command under Linux systems and is often used to back up files or directories.
When mv operates files, it moves and renames them.
The target directory is the same as the original directory. If a new file name is specified, the effect is just renaming.
How to check the hostname of Linux host name?
Redhat6 takes as an example to display the host name #hostname displays the host name #hostnamelinux01 The host name is temporarily set to linux01. Set the host name. Change the following file #vim/etc/sysconfig/networkHOSTNAME=linux01 The host name is set to linux01, permanently valid
How to rename a user account in Linux?
You can use the usermod command to change the username in Linux. The specific operation method is as follows:
1. First open the Linux terminal and enter the command to modify the username. A simple username modification is usermod adds parameter l, followed by the new username, and finally the old username.
2. At this time, use the cd command to go to the home directory. You will find that there is a small problem, that is, you can only modify the user name but not update the user file in the user directory.
3. If you want to update the folder name in the home directory, you also need to use parameter d, followed by the path of home and the new user name. Add the m parameter and the new user name to update the user. The name of the directory is gone
How to change the user password in Linux?
Linux uses the administrator to change the user password and needs to operate in the system terminal.
The steps to use the administrator to change the user password in the Linux system terminal are as follows:
1. Click to enter the Linux system terminal program.
2. Enter the sudopasswd command in the system terminal program.
3. Enter the user name whose password needs to be changed after the sudopasswd command.
4. Enter the administrator password.
5. Enter the password that needs to be changed.
6. Re-enter the new password.
7. As shown in the picture, the password is changed successfully.
How to change the server name reference method under Linux system?
In the hostname file, change the original host name to the new one. In the hosts file, you can
change the original host name resolved by 127.0.0.1 to the new host name
------------- -------------------------------------
1. Modify the linux server name
#vi/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=yourname//Modify hostname here
2 .Modify the name in /etc/hosts
#vi/etc/hosts
omainlocalhost
127.0.0.1yourname//here Modify hostname
3. Finally execute the hostname command in the terminal
#hostname*****//***** is the modified hostname
hostname command The host name is only temporarily changed, and the host name will be restored to the original after restarting.
To permanently change the host name, you need to modify the /etc/sysconfig/network file.
View host name command
#uname-n
#Centos
How to modify the user name in Linux system?
-d/home/the user name you want to modify> -m previous user name -l modify user Name -d changes the path used after login -m changes the login name and also changes the directory name上一篇:虚拟机linux怎么改主机名
下一篇:linux虚拟机修改用户名和密码