1, add the user, first with the AddUser command to add a normal/system user, the command is as follows:
# AddUser [-r]–d/tommy Tommy
Add a user named Tommy
# passwd Tommy//Change Password
Changing password for user Tommy.
New UNIX Password://Enter your password here
Retype new UNIX Password://Enter password again
Passwd:all authentication tokens updated successfully.
2. Give root permission (recommend this method)
Modify the/etc/sudoers file, locate the following line, and add a line below root as follows:
# allow ROOT to run any commands anywhere
Root all= (All) all
Tommy All= (All) Nopasswd:all
After the modification, you can now log in with your Tommy account and then use the command sudo-i to get root permission to operate.
This article is from the "Change" blog, so be sure to keep this source http://changeflyhigh.blog.51cto.com/8317626/1953691
Add users under Linux and give root privileges