If you have any questions or suggestions, feel free to leave them in the comments. With that, you’ve given a user sudo permissions! The commands should be mostly, if not completely functional on other distros such as Debian, Fedora, or Arch Linux. Look for the same output as mentioned before. Step 2: Toggle the Administrator switch to on.Īnd that’s it! If you want to see if it worked, log in as the user you gave administrator permissions to and try running the same command as before. Enter your password when prompted to do so. Step 1: Open up the Settings application, go to ‘Users’ and click ‘Unlock’. Giving a user sudo permissions on Ubuntu Desktop is a simple two-step process: Giving sudo access to a user on Ubuntu Desktop If you get an error about the user not being in the sudoers file, try going through the instructions again, or you can use the graphical method below. If everything’s set up correctly, it’ll output I am root!. You can check if the user is part of sudo group with the following: groups usernameĪlternatively, you can log in as the other user you just gave sudo access to and run a command with sudo. There are various ways you can check if a user has sudo access. How to verify if the user has sudo access You’ll find the username near the end of the command’s output. If you don’t know the exact username, you can list the users on your system using the compgen -u command. username: This is the name of the user you want to add to the sudo group.sudo: the second sudo in the command represents the sudo group.If you exclude the a option, the user would be removed from all its groups except sudo (you don’t want that). So, this adds the specified group to the specified user, without touching the user’s existing groups. -aG: The a option means append(or add), G is for groups.usermod: The usermod command is used for modifying an existing user in Linux.Let’s go over what that command just did: Just adding the user to the sudo group takes care of everything. The above command adds the user to the sudo group, which is used to track the users who are allowed to have sudo permissions. Giving a user sudo permission from the command line is just a single command if you know the username of the user: sudo usermod -aG sudo username Giving sudo permissions from the command line Lastly, to give sudo access to another user, you must have sudo access yourself. I’m assuming any users you’re doing this for have already been created. Is there a way to debug, why does switching to root take a lot of time I believe, that there is some script which is performed just after switching and consumes this time, but I can't find path to this. (su - root) However, switching to any another user takes less than 1 second. Note: this tutorial is not about creating users in Ubuntu. I have a system (RHEL) and switching to root takes about 1 minute.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |