![add user to sudo add user to sudo](https://www.howtogeek.com/wp-content/uploads/2019/11/19-3.png)
![add user to sudo add user to sudo](https://phoenixnap.com/kb/wp-content/uploads/2021/04/sudo-command-add-user-debian.png)
Run a command that requires superuser access. You have to replace the username with the name of your user account. You can do it by running the command shown below. Switch to the user account you have created. To verify the new user has sudo privileges: Verify the new Debian sudo user is added to the group with the command: getent group sudo Username is the user account you want to add to the sudo group. Sudo is the group that is appended to the options mentioned above. The -G option is used to state where to add the existing user. It does that without removing them from the current groups. aG is an option that adds the user to a specific group. The command consists of the following components: Run the command shown below and add a user to the sudo group: usermod -aG sudo username Users that have root privileges can add any account to the sudo group.Įveryone in the group automatically gets sudo access to Debian and Ubuntu operating systems. In the terminal, you will be prompted to change the user information.Īdd the details in the text editor or press Enter to leave the fields blank.
#ADD USER TO SUDO PASSWORD#
Set a strong password for accounts with sudo access. The sudo command creates a home directory for the user and copies all the necessary files.Įnter the password for the user account and retype to confirm it. You can create a new user with the adduser command as a root user.Īppend the required user account name to the command: adduser usernameįor example, add a new account sudo_user with the command: adduser sudo_user Before adding a user to your system, log in to your server as the root user: ssh the above line, replace ip_address with the IP address of your server.