Thursday, June 22, 2006

Root Access with sudo and gksudo

ubuntu unlike many distributions does not normally have a user accessible root account. You are supposed to use one of these two commands when you need root access. sudo is for when you are in the terminal and need root access and gksudo is when you are in the GUI and need root access, for example you can press alt+f2 and type "gksudo appname".

If you need a root account for some reason, an easy way to do it is to open up the user account manager by pressing alt+f2 and typing gksudo users-admin.

Double click on the root account and you will be presented with this screen. You may change the root password from there.

You may now log in as root. Note that gdm (the login manager for ubuntu) might not let you log in as root so you will have to open the console and login and run "startx".

To add new users to sudo, open the terminal and type "sudo usermod -G admin username". If the user is already a member of other groups, you'll want to add the -a option, like so: "sudo usermod -a -G admin username".

If you prefer to use the GUI, open users-admin and double click the user you want to be able to sudo. Under the User privileges tab, check the box that says "Executing system administration tasks" and they will be able to sudo.

No comments: