Modify User Privledges

Started by
9 comments, last by GameDev.net 18 years, 7 months ago
Okay when you install Ubuntu it does not give you a choice to create a root password, it simply allows u to create 1 user/pass which has the rights to modify the root password via sudo and a few other various root functions. So on my first boot to Ubuntu GUI I "sudo passwd root" I believe was the command and set a root password. Then I took away a bunch of privledges from that first account. Now, you cannot log into the GUI as root. I need to know how to manually modify the priveledges of a user via the shell. Since I for some reason can no longer use that first user account to modify the User Accounts via the GUI.
Advertisement
The su command allows you to switch users. You can almost certainly still log in as root from a console.
Look at the usermod command to modify the groups a user belongs to: to be able to su to the root account, a user must belong to the wheel group.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Ubuntu is like Mac OS X where the root user is disabled by default. On a standard install running su to become root will fail - if you need to do something that requires root privileges use sudo instead. You can run a shell with root privileges with:
sudo -s

More info here.
There's also more info at the ubuntu wiki.

Apparently:
sudo -i
might be better than sudo -s
Okay, logged into GUI as Hal -- the only other user, which cannot do any root stuff.
Open up termine and type "sudo -i"
Then it asks for the password, so I try the root pass and it fails, I try the pass as Hal and it reports the incident attemp cause Hal is not the in sudo user list.
Some questions:
Hal was the first user you created during the install?
What were the privileges you took away from the first account?
Did you also try su (it shouldn't work, but perhaps now that you've given the root user a password it might)?

sudu su might also work, but probably won't since sudo -i didn't.

You also might want to consider whether you really want a root user at all. The ubuntu wiki I linked to above has a decent overview of the pros and cons. As far as i'm aware, there aren't many reasons why you'd want to in Ubuntu - you can do just about anything with sudo in an admin account.

One other thing I can think of is adding Hal to the sudoers file (which may be a bit difficult if you can't access the root user or get root privileges). Read the sudo man page and the info in the /usr/share/doc/sudo/ directory.
Yes I set the root password on first boot.
I can log into root on a plain shell (Ctrl+Alt+F1-6).
Not sure what to tell you. If I had access to your machine I might be able to get things working right - but if you're still having problems my advice is to reinstall.

Once you've done that ask yourself whether you actually need a root user with a password in Ubuntu. Can you get by with an admin account and sudo?
I cannot get by at all how it is setup.

I do not know how to modify priviledges via the shell as root.
I can no longer do it via Hal because I took away those abilities.
Since I took away those abilities for Hal I cannot use the GUI for anything! Networking, Sharing, User Group Modifications, etc.

I need to give Hal his rights back somehow via root.
(A slightly screwy way of doing it, but...)

To log in to desktop with root:
using one of the text terminals (ctrl-Alt-F1), log in as root and edit the file /etc/gdm.conf [1] and change the line

AllowRoot=false

to

AllowRoot=true

then restart gdm and log in as root and away you go.

Alternatively (from memory):
change /etc/sudoers to include your desired user. [2]

Alternatively 2:
As root in one of the terminals run the command:
adduser admin
should restore s ability to sudo

[1] I'm not sure this is the right path. The file you need to edit is called gdm.conf anyway.

[2] As root, edit the sudoer file using the command visudo. Check the man page for visudo for how it works. I'm not at my Ubuntu box just now, so I can't check.

This topic is closed to new replies.

Advertisement