Advertisement

Ubuntu Question

Started by February 19, 2006 12:00 PM
12 comments, last by 255 18 years, 8 months ago
Quote:
This is getting really rediculous, I need to be able to simply restore *ALL* rights to this user.

There is a way to gain admin permissions temporary by using a live-cd/rescue disk, but it is not exactly trivial...
Quote: Original post by gamechampionx
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.


You didn't quite take my advice if you typed "sudo adduser brendan admin". :-) You need to pass the kernel the init=/bin/sh parameter so that you *don't* need to use sudo (since you can't without the password).

Here's what I did. It's a bit trickier than I thought because of initrd :

boot normally in Ubuntu and as a plain user, read /boot/grub/menu.lst. I used "less", but you can use any text editor you want to read it, it's just plain text. Find the menu entry below ## ## End Default Options ##. You'll see something like this:


title Ubuntu, kernel 2.6.12-10-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.12-10-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.12-10-386
savedefault
boot


Write this down (beware of typos) or print it for future reference, then reboot and get Grub to give you a command line (here I have to hit Escape and once at the menu hit 'c'). Once you see the "grub> " prompt, type :


grub> root (hd0,0)
grub> kernel /boot/vmlinuz-2.6.12-10-386 root=/dev/hda1 rw init=/bin/sh
grub> initrd /boot/initrd.img-2.6.12-10-386
grub> boot


Substitute this with the values you got from /boot/grub/menu.lst if they differ. Note that Grub will write the result of each command after you press enter. I didn't bother writing it down here. Be wary of typos are Grub has no way to assert that your command is correct in many cases (most of it is passed "as-is" to the kernel).

Wait for it to boot up then:


# groups brendan
brendan adm dialout cdrom floppy audio dip video plugdev lpadmin scanner
# useradd brendan admin
# groups brendan
brendan adm dialout cdrom floppy audio dip video plugdev lpadmin scanner admin
# sync
# reboot


If you get an error message when trying to use "useradd" telling you that it couldn't acquire a lock, it's possible that the partition was remounted read-only after an error. Remount it with read-write permissions:


# mount -o remount,rw /dev/hda1 /


And try again. I did all the above here and it worked flawlessly.


Hope this helps.
Advertisement
Thanks. I found the other way to do it..... reinstall Linux, lol. I guess this is what I get for deadministrating myself. I do appreciate the tips though, as I'm new to administrative junk.

I want to install the jdk and jre for Ubuntu and I'm wondering if there's an easy way to do this. By typing "man java", it appears the Java Virtual Machine is invoked with gij, but I'm wondering if there's an easy way to get the compiler set up, and have it run the natural "java" command, if it even exists in Linux.
Check out Drunken Brawl at http://www.angelfire.com/games6/drunken_brawl!
You should spend some time at the ubuntu wiki. How to install sun's jre and many other frequently asked questions are answered there. If you still need help, search the ubuntu forums.

This topic is closed to new replies.

Advertisement