How Do I Assign a User to Sudo in Linux?
Contents How Do I Add a User to Sudo in Linux? Steps to Create a New Sudo User on Ubuntu First Add the User, Run: Sudo Adduser Add the User to Sudo Group by...
Contents
How do I add a user to sudo in Linux?
Steps to create a new sudo user on Ubuntu
- First add the user, run: sudo adduser <UserNameHere>
- Add the user to sudo group by typing the command in terminal for Ubuntu version 12.04 and above: sudo adduser <UserNameHere> sudo.
- In older version of Ubuntu (version 12.04 and older), run: sudo adduser <UserNameHere> admin.
Must Read
How do I change user to sudo?
Another way to switch to another account with sudo is to use the -s option. If you run sudo -s that will start a shell as root. You can specify a user with the -u option.
…
Using sudo.
| Commands | Meaning |
|---|---|
| sudo -u root command | Run command as root. |
| sudo -u user command | Run command as user. |