PDA

View Full Version : [ubuntu] Sudoers - Reboot Recovery



timwebuk
May 5th, 2010, 07:13 PM
Wasn't sure which forum entirely to post this in... I seem to have done something completely noob and remove myself from the sudoers file...?! Somehow... I've no idea, I was playing with the chgrp last night, but upon reboot today I no longer am in it.

I read I need to reboot in recovery mode but how I can reboot without root?

Also, I'm still not entirely sure what I've done or how to resolve it, so any tips would be MUCH appreciated.

Cheers.

I'm running Ubuntu Lucid Server

cdenley
May 5th, 2010, 07:36 PM
Did you try doing ctrl+alt+del? Maybe press the power button once? If you're really desperate, you can pull the plug, but that might risk file corruption.

You probably removed yourself from the admin group. When you get a root shell from recovery mode, run this command, replacing "username" with your username:


adduser username admin

timwebuk
May 5th, 2010, 07:45 PM
Wow I feel like a noob!

Thanks for the help.

Should I add a password to the root account? As I read that it's 'disabled' in Ubuntu by default. I just didn't like the idea of booting in recovery and having straight access to root

Cheers.

sisco311
May 5th, 2010, 07:48 PM
EDIT: too late. :(

Try "Raising Elephants" (http://en.wikipedia.org/wiki/Magic_SysRq_key#.22Raising_Elephants.22_mnemonic_d evice) :).

Holding down Alt and SysRq while slowly typing REISUB will get you safely restarted.

cdenley
May 5th, 2010, 07:49 PM
Wow I feel like a noob!

Thanks for the help.

Should I add a password to the root account? As I read that it's 'disabled' in Ubuntu by default. I just didn't like the idea of booting in recovery and having straight access to root

Cheers.

I recommend you don't set a password for root. That ensures nobody will authenticate as root, in case you install software for remote logins or someone gains local access somehow.
https://help.ubuntu.com/community/RootSudo

sisco311
May 5th, 2010, 08:15 PM
I recommend you don't set a password for root. That ensures nobody will authenticate as root, in case you install software for remote logins or someone gains local access somehow.
https://help.ubuntu.com/community/RootSudo

+1


Wow I feel like a noob!

Thanks for the help.

Should I add a password to the root account? As I read that it's 'disabled' in Ubuntu by default. I just didn't like the idea of booting in recovery and having straight access to root

Cheers.

Then set up a grub password. A root password doesn't disable the ability to boot into a root shell, one could edit the grub entry and boot with the rw init=/bin/bash kernel parameters or simply boot a live CD/USB. ;)

Check out Physical access is root access from the Recurring Discussions forum. :)

timwebuk
May 6th, 2010, 12:59 AM
Thanks guys, I'll have a look into passwording the grub file. No doubt it'll go wrong, but I've learnt a hell of a lot so far just by doing things I probably shouldn't.