Method 1:
useradd -u 0 -o -g root -G root -d /home/keio keio When
specifying an empty password for a user, execute the following command:
# passwd -d keio
delete user
# userdel -r keio
Method 2:
If you want to add an account admin with root authority, you can refer to the following steps. Of course, the following steps must be run with root authority:
Step1 Add a general user admin.
useradd -m admin
Step2 Change the password of admin. After
passwd admin
runs, the system will ask for the password. After entering it, it will be confirmed again.
Step3 Change both the uid and gid of admin to 0
, use a text editor, change
admin:x:1001:100::/home/admin:/bin/bash to
admin:x:0:0::/home/admin :/bin/bash will do.
Method 3: To
add a user, first add an ordinary user with the adduser command, the command is as follows:
#adduser tommy //Add a user named tommy
#passwd tommy //Change password
Changing password for user tommy.
New UNIX password: //Enter the new password here
Retype new UNIX password: //Enter the new password again
passwd: all authentication tokens updated successfully.
Grant root privileges
Modify the /etc/sudoers file, find the following line, and add a line below root, As shown below:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
keio ALL=(ALL) ALL
Method 4:
Clone the ROOT account
Create a new normal user system
# useradd system
# passwd systemAdd
root shell
# vim /etc /passwd
system:x:0:0:root:/root:/bin/bash
# vim /etc/shadow
system:$1$OULjNnw/$kAyt7S.RzTJwSwlllflI3F1:14921:0:99999:7:::
Add to root group
#vim /etc/group
root::0:root,systems