Home  >  Article  >  Operation and Maintenance  >  How to change the root user name in Linux

How to change the root user name in Linux

WBOY
WBOYforward
2023-05-18 19:50:507588browse

1. Taking CentOS as an example, modify /etc/passwd and /etc/shadow after logging in, change the root starting in the first line to a new user name (such as admin), and pass wq! # after modification. ##save.
How to change the root user name in Linux

How to change the root user name in Linux

2. After modification and saving, it will take effect after restarting the server. You can check the permissions of the file and you can see that the account column changes. It is admin, as follows:


How to change the root user name in Linux

Note: The default user with the highest administrative authority in Linux is root, and the uid is 0. Only uid is recognized in the system, so as long as uid is 0, the system considers the top administrative user. However, there may be certain problems with applications. Some software uses the root user by default. Therefore, if the understanding of the software application is limited, it is not recommended to adjust the user name for root.

The above is the detailed content of How to change the root user name in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete