How to modify the root user name in Linux

08-01-2023

The knowledge points of this article on how to modify the root user name in Linux are not well understood by most people, so the editor summarizes the following content for you. The content is detailed, the steps are clear, and it has certain reference value. I hope you can read this article. This article can gain something, let's take a look at this article on how to modify the root user name in Linux.

1. Taking CentOS as an example, after logging in, modify /etc/passwd and /etc/shadow, change root at the beginning of the first line to a new user name (such as admin), and pass wq! Save.

2. After modifying 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 number has changed to admin , as follows:

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

The above is the content of the article about how to modify the root user name in Linux. I believe everyone has a certain understanding. I hope that the content shared by the editor will be helpful to everyone. If you want to know more Content, please pay attention to Yisu cloud industry information channel.

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us