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 read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
NiksaVel
Level 5
Level 5
Posts: 782
Joined: Wed Feb 28, 2007 4:06 am
Location: Croatia
Contact:

Post by NiksaVel »

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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
sanguinemoon
Level 2
Level 2
Posts: 77
Joined: Tue Mar 20, 2007 5:08 am

Post by sanguinemoon »

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

Post by sanguinemoon »

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

Post by sanguinemoon »

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

Post by sanguinemoon »

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

Post by sanguinemoon »

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 :(
ido
Level 1
Level 1
Posts: 42
Joined: Fri Dec 29, 2006 10:08 pm
Location: Buenos Aires, Argentina

Post by ido »

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.
Locked

Return to “Other topics”