Sudo has stopped working. Is there a Rescue Mode?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

Sudo has stopped working. Is there a Rescue Mode?

Postby major day on Sun Apr 08, 2007 4:45 pm

Hi all, not sure what category this belongs in, so I'm asking here.

I was installing VirtualBox, when the Sudo command stopped working. Using it doesn't change anything, doesn't put me in root, for example. I do get asked for my password.

One other thing has broken as well; my soundcard is no longer seen and attempting to open the volume control gives me this error message; -

No volume control GStreamer pluginsa and/or devices found.

I doubt if these two things are connected, and I have been messing around with my system lately, so it's possible that I've broken it.

Is there a Rescue Mode?

Or failing that, can anybody point me in the right direction, please?

Thanks,

Major Day
major day
Level 1
Level 1
 
Posts: 11
Joined: Sun Feb 25, 2007 2:28 pm

Linux Mint is funded by ads and donations.
 

Postby NiksaVel on Sun Apr 08, 2007 5:00 pm

I was installing VirtualBox, when the Sudo command stopped working. Using it doesn't change anything, doesn't put me in root, for example. I do get asked for my password.


ahem... you do realise that sudo doesn't "put" you in a root mode, it just executes the command as root....


if you want root mode use

Code: Select all
sudo su
User avatar
NiksaVel
Level 5
Level 5
 
Posts: 806
Joined: Wed Feb 28, 2007 4:06 am
Location: Croatia

Postby sanguinemoon on Sun Apr 08, 2007 6:28 pm

I doubt you really need a rescue mood for these issues. Rescue mood is for if you can't boot up at all or possibly if you can't boot to a gui.

If somehow you uninstalled that plugin, just reinstall it through Synaptic.

If you do sudo (command) and it asks you for your password and you can execute your command, it seems like it's working as its supposed to.
User avatar
sanguinemoon
Level 2
Level 2
 
Posts: 77
Joined: Tue Mar 20, 2007 5:08 am

Postby major day on Mon Apr 09, 2007 5:55 am

I can't use Synaptic. When I try, I get the following error message;-

Failed to run /usr/sbin/Synaptic as user root.

The underlying authorisation mechanism (Sudo) does not allow you to run this program. Contact the system administrator.


I can't use any command with sudo in it; it doesn't work.

Yes, it asks for my password, but I don't then get root privileges. I'm still user john.

The easy way out of this would be to just re-install Mint, but I'm trying to learn how to deal with the situations that crop up from time to time without resorting to using a sledgehammer to crack a nut.

Thanks, guys, for coming back on this. If you have any more ideas, I'd love to hear them.

Major Day
major day
Level 1
Level 1
 
Posts: 11
Joined: Sun Feb 25, 2007 2:28 pm

Postby sanguinemoon on Mon Apr 09, 2007 2:36 pm

Do this


Code: Select all
ls -l /usr/bin/sudo


It should look like

Code: Select all
-rwsr-sr-x 1 root root 91508 2006-10-09 07:37 /usr/bin/sudo


Post your output here
User avatar
sanguinemoon
Level 2
Level 2
 
Posts: 77
Joined: Tue Mar 20, 2007 5:08 am

Postby major day on Mon Apr 09, 2007 3:06 pm

The result i get is; -

-rwsr-sr-x 1 root root 91508 2006-10-09 12:37 /usr/bin/sudo

Looks pretty much as it should, I think.

Cheers,

John
major day
Level 1
Level 1
 
Posts: 11
Joined: Sun Feb 25, 2007 2:28 pm

Postby sanguinemoon on Mon Apr 09, 2007 3:46 pm

Yeah, that does look right. So it wasn't what I thought it might be, which would actually be an easy fix.

I have one other idea and if this doesn't work, reinstalling is probably the easiest way. Boot into the livecd and do.

Code: Select all
 nano (where the livecd mounts the hard disk that you have mint on) /etc/sudoers


In this I'm assuming the livecd has nano. This is a tiny bit of a hack because normally you can only edit /etc/sudoers using visudoers, which wouldn't work because that command doesn't allow you to enter a path. But I noticed that Mint actually uses nano for this, and not vi. Anyway, the point is make sure the last lines of /etc/sudoers look exactly like this:

Code: Select all
 # User privilege specification
root    ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL


If not, change them to match. Saving in nano is easy, just Ctrl 0 for write out. If this doesn't work, my guess would be that you somehow managed to take yourself out of the admin group.
User avatar
sanguinemoon
Level 2
Level 2
 
Posts: 77
Joined: Tue Mar 20, 2007 5:08 am

Postby major day on Mon Apr 09, 2007 4:56 pm

Okay done that. Both lines look exactly the same as your examples.

I suppose I might have done as you suggest, and removed myself from the admin group, but I don't know how I'd have done that; certainly not intentionally.

Have you any thoughts on how I might put myself back on the admin list?

Thanks again,

John
major day
Level 1
Level 1
 
Posts: 11
Joined: Sun Feb 25, 2007 2:28 pm

Postby sanguinemoon on Mon Apr 09, 2007 6:04 pm

This is getting tricky . The things that I can think of that you need do to fix this require that you have sudo working in the the first place. sudo -i simulates a login as root so you can edit the /etc/group file so that your user is in the admin like like "admin:x:(number):(username)", but I think you already see the problem with that...
User avatar
sanguinemoon
Level 2
Level 2
 
Posts: 77
Joined: Tue Mar 20, 2007 5:08 am

Postby sanguinemoon on Mon Apr 09, 2007 6:19 pm

Silly me! From the livecd sudo nano (where the live cd mounts Mint)/etc/group If your username isn't in the admin line, add it.

If this still doesn't work, I don't know :(
User avatar
sanguinemoon
Level 2
Level 2
 
Posts: 77
Joined: Tue Mar 20, 2007 5:08 am

Postby major day on Tue Apr 10, 2007 2:35 am

Very interesting.

I'm also running Ubuntu Feisty (and I'm using that rather than the live CD to examine the files you suggested I should look at), and comparing the two /etc/group files shows that my username appears thirteen times in the Feisty group file, and not once in the Mint group file.

The two files aren't identical, which gives me a bit of a problem; how do I know where to insert my username? Can I rebuild group?

Well, it looks as if you've guided me to the right place. Unfortunately, now we're here, I'm not sure what to do next. Any thoughts?

Many thanks for your help so far,

John
major day
Level 1
Level 1
 
Posts: 11
Joined: Sun Feb 25, 2007 2:28 pm

Postby major day on Tue Apr 10, 2007 3:28 am

Okay, onwards and sideways....

I thought I'd have a go, and add my username where I could be sure it should be. (There are lines in the Ubuntu group that are'nt in the Mint group.)

The good news; - I've now got my sound back.

The bad news; - sudo still doesn't work; I still don't become root in the terminal, and I still can't use Synaptic, although the message has now changed. It now reads; -

Failed to run /usr/sbin/synaptic '--hide-main-window' '--non-interactive' 'parent-window-id' '46137347' '--update-at-startup' as user root.

The underlying authorization mechanism (sudo) does not allow you to run this program. Contact the system administrator.


Possibly I need to add my username to another line in /etc/group.

I don't know if it'll help, but this is what it looks like at the moment; -

root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:john
tty:x:5:
disk:x:6:
lp:x:7:cupsys
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:cupsys,john
fax:x:21:
voice:x:22:
cdrom:x:24:haldaemon,john
floppy:x:25:haldaemon,john
tape:x:26:
sudo:x:27:
audio:x:29:john
dip:x:30:john
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:john
sasl:x:45:
plugdev:x:46:haldaemon,john
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
dhcp:x:101:
syslog:x:102:
klog:x:103:
ssl-cert:x:104:cupsys
crontab:x:105:
ssh:x:106:
messagebus:x:107:
avahi:x:108:
lpadmin:x:109:john
haldaemon:x:110:
scanner:x:111:cupsys,hplip,john
slocate:x:112:
gdm:x:113:
fuse:x:114:
john:x:1000:
admin:x:115:
vboxusers:x:1001:john

Can you tell if any lines are missing? Or should my username appear anywhere else?
Bye now,

John :?
major day
Level 1
Level 1
 
Posts: 11
Joined: Sun Feb 25, 2007 2:28 pm

Postby ido on Tue Apr 10, 2007 4:01 am

hi,

In the line before the last one (group file) you have : adm:x:115:
There I think you have to add your user name as you did at the beginning of the file, that is where it was something like adm:x:4: john.
ido
Level 1
Level 1
 
Posts: 42
Joined: Fri Dec 29, 2006 10:08 pm
Location: Buenos Aires, Argentina

Postby major day on Tue Apr 10, 2007 5:04 am

Yep, that did the trick.

That's great.

Thanks to everybody that helped me get Mint back in Mint condition (Ha ha).

I wonder what caused the problem to happen in the first place....

Cheers all,

John :D
major day
Level 1
Level 1
 
Posts: 11
Joined: Sun Feb 25, 2007 2:28 pm

Linux Mint is funded by ads and donations.
 

Return to Other topics

Who is online

Users browsing this forum: No registered users and 4 guests