Advertisement

Ubuntu Question

Started by February 19, 2006 12:00 PM
12 comments, last by 255 18 years, 8 months ago
In Ubuntu, I've been learning how to add and modify users. I tried changing my first user's privileges to have all permissions except for administrative control. I later read that the first user, in Ubuntu, should always be an administrator. I want to change back the setting but I can't get into the graphical "Users and Groups" menu item, it starts up and then closes, probably because of my non-administrative rights. How can I fix this, and is the correct reason for the "manager" not opening?
Check out Drunken Brawl at http://www.angelfire.com/games6/drunken_brawl!
If no user on your system as administrative privileges and the root password is not set (do your remember setting it during installation?) then there is no way to give administrative privileges to any user without modifying the installation with another OS. Get a bootable live CD distribution, mount the partition you installed ubuntu on and edit your installation's /etc/groups to put your user back into the administrators' group. This can be a bit difficult if you don't have experience with unix systems. There are some guides on the internet on this (usually using the Knoppix live CD), but it would probably be much easier for you to simply reinstall.

The process goes approximately as follows:
- boot a live CD and open a terminal
- run su to gain root privileges
- run mount /dev/<your_install_partition> /some/directory (e.g. mount /dev/hdb1 /tmp/ubuntu)
- edit /tmp/ubuntu/etc/group and place your user into the administrators' group (I can't remember which one it was in ubuntu, but I'm sure you can find this information somewhere.)
- umount /tmp/ubuntu
- reboot
Advertisement
Is what you call the "first user" the root user?
255, is that also possible using the terminal in ubuntu? I'm guessing no because you need admin privliges to use su, right?
@pulpfist: Ubuntu has no root user. Users can have admin priviledges. This gives them the ability to use sudo in combination with their own passwords. All Ubuntu programs can be used through sudo. No root user is required. This can be changed though, by doing "sudo passwd root" and setting a root password. From then on you can su to root. Also sudo will require the root password instead of the user's password to work.

@Ganoosh_: Yes, you need root priviledges to edit /etc/passwd, hence the reason for a live CD. You could try the rescue option instead of a Live CD. See http://help.ubuntu.com/starterguide/C/ch08.html

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

The root user (or "super-user") is a unique user with the UID (user-id) 0 who always has permissions to do absolutely anything with any file. Traditionally unix operating systems have worked so that all administrative functions are performed as the root user. Ubuntu has a slightly different approach here (one similar to Mac OS X acutally). In Ubuntu the root user is not given a password by default and it is thus impossible to log in as root. Instead, regular users belonging to a specific group are able to assume administrative privileges temporarily through the sudo command using their own passwords.

su and sudo are two quite similar commands. Both change the effective user ID of the shell. sudo is a bit more advanced because it has a configuration file where one can specify some more advanced rules, whereas su does little besides switch the UID. See the manual pages of both commands for more information.
Advertisement
Quote: Original post by 255
If no user on your system as administrative privileges and the root password is not set (do your remember setting it during installation?) then there is no way to give administrative privileges to any user without modifying the installation with another OS.


Ubuntu doesn't use the root account per se (that is, it has no password and it is not possible to login using that account). The first user is added to the sudoers with all privileges, much like in Mac OS X. It is possible to activate the root account by assigning a password to it. Obviously that requires administrative privileges.


gamechampionx :

I wouldn't be surprised if all it required were to add your user name back to the "admin" group. I don't use Ubuntu though. Here's what I'd try :

- get lilo/grub/yaboot/... to give you a command line (usually "tab", "c" or something like that) and boot with "linux init=/bin/sh";

- add the user back to the "admin" group (or whatever other group that gives admin privileges) by typing "adduser user_name group_name". Replace "user_name" with your user's login name and "group_name" with the administrative group name ("admin" or "wheel" is my guess). AFAIK this way of adding users to a group is "Debian specific" (and thus will work with Ubuntu). On other distros you'll probably want to use "groups" and "usermod";

- reboot normally, see if it works now.


If that doesn't work, then try the live CD solution, and hope that the groups DB gets rehashed on the next reboot.


Hope this helps.
I checked the groups I'm currently in and it lists: brendan (my user name), adm, dialout, fax, cdrom, floppy, tape, audio, dip, video, pludgev, lpadmin, scanner .

I have no way to determine the name of the group that I'm "missing". Is there a way to use the adduser command to add a user to all of the non-user-based groups?
Check out Drunken Brawl at http://www.angelfire.com/games6/drunken_brawl!
Quote: Original post by gamechampionx
I checked the groups I'm currently in and it lists: brendan (my user name), adm, dialout, fax, cdrom, floppy, tape, audio, dip, video, pludgev, lpadmin, scanner .

I have no way to determine the name of the group that I'm "missing". Is there a way to use the adduser command to add a user to all of the non-user-based groups?


I installed Ubuntu on a spare box and the admin group is... "admin". :-)


Hope this helps.
I took your advice and ran "sudo adduser brendan admin" but this didn't change the result of the command "groups brendan". I then tried to access System > Administration > Users and Groups. It prompted my for a password, which I entered. It then just did nothing. If I try to click on that option a second time, I get "Starting Users and Groups", which then closes itself from the taskbar. This is getting really rediculous, I need to be able to simply restore *ALL* rights to this user.
Check out Drunken Brawl at http://www.angelfire.com/games6/drunken_brawl!

This topic is closed to new replies.

Advertisement