Add a new user account with admin access on Linux

https:‮ww//‬w.lautturi.com
Add a new user account with admin access on Linux

To add a new user account with administrative privileges on Linux, you will need to log in as the root user or another user with sudo privileges. Once logged in, you can use the following steps to create a new user and grant them administrative privileges:

  1. Use the useradd command to create a new user account. Replace <username> with the desired username for the new account:
useradd <username>
  1. Set a password for the new user account with the passwd command. Replace <username> with the username of the new account:
passwd <username>
  1. Add the new user to the sudo group using the usermod command. Replace <username> with the username of the new user:
usermod -aG sudo <username>
  1. The new user should now be able to use the sudo command to run commands with administrative privileges. You can verify that the user has been added to the sudo group by running the following command and checking the output for the sudo group:
groups <username>

Note: The steps above are for systems that use the sudo command to grant administrative privileges. If your system uses a different method to grant administrative privileges, you may need to use a different set of steps to add a user with admin access.

Created Time:2017-10-15 18:21:13  Author:lautturi