Create an account with root privileges under Linux
Useradd-u 0-o-G root-g root-d/home/user1 user1
Usermod-u 0-o-G root-g Root user1
Description
-U 0: Specifies that the UID is specified as 0 (0) as root, and the prompt after login is # instead of $.
-O: This parameter must be specified because the UID is duplicated (repeat with the root account uid).
-G Root: The group name of the initialization group, when the user belongs to more than one group, (as specified in the-G parameter), the group in which the login is located. By default, the system creates a new group with the same name as the user name, and is set to the group name when it is initialized. Regardless of which group-G is specified.
-G root: Specifies the list of groups to which the user name belongs, a user can belong to more than one group, the group name is separated by commas, and the group name must already exist.
-d/home/user1: Specify the user's home directory
User1 new user name User1
Test: You can test the properties of user name User1 with the ID user1 command, shown as:
Uid=0 (Root), gid=0 (Root), group=0 (Root)
Description: GID indicates that the GID number is initialized.
- This article is from: Linux Tutorial Network
Create an account with root privileges under Linux