PDA

View Full Version : [ubuntu] Whats up with SUDO?



prenger745
May 15th, 2008, 01:35 PM
Until just now I have been able to open a terminal window and type 'sudo' then whatever I wanted to do. It would ask for my password, I would enter it and it would run my command. Now, all of a sudden, when I type sudo (+some command) I get this:

dmcgurk@dan:~$ sudo fdisk -1
sudo: must be setuid root
dmcgurk@dan:~$

Not only that, now when I try to mount my harddrive I get this error:

Error org.freedesktop.DBus.Error.AccessDenied

Details:

A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.Hal.Device.Volume" memeber "Mount" error name "(unset)" destination "org.freedesktop.Hal")


I have no idea what I did or how to fix it :-(

Thanks,
Dan

unutbu
May 15th, 2008, 02:07 PM
I'm not sure I know how to solve your problem, but it might be helpful to boot from the LiveCD so you can use a different operating system to examine your hard drive.

Then mount your hard drive at, (just for specificity) say, /media/disk.

In a terminal:


% ls -l /media/disk/usr/bin/sudo

It should look like this:


-rwsr-xr-x 1 root root 91776 2007-06-15 08:49 /usr/bin/sudo

Notice the 's' in the permissions line. That indicates sudo has the suid bit set. The error message


sudo: must be setuid root

seems to suggest this bit is not set.
If you find that your suid bit is not set, then the fix may be to reinstall the sudo package. You may need some special instructions to do this without the sudo command. Post if you're having trouble with that.

Also, this will not explain how your machine ended up like this, and it may be worth trying to figure that out so this doesn't happen again.

The


Error org.freedesktop.DBus.Error.AccessDenied

seems to be generated when some config file in
/etc/dbus-1/system.d is not right. See

http://osdir.com/ml/debian.devel.evolution/2006-09/msg00024.html

Unfortunately, blindly following that poster's solution probably won't work since his problem was somewhat different. I don't know exactly what you'd need to fix yours, short of reinstalling the dbus package.

BlueSkyNIS
May 15th, 2008, 02:17 PM
Follow unutbu suggestions and setuid can be set with:

(following his example)

chmod u+xs /media/disk/usr/bin/sudo

Dr Small
May 15th, 2008, 04:25 PM
Follow unutbu suggestions and setuid can be set with:

(following his example)

chmod u+xs /media/disk/usr/bin/sudo
Why not boot into recovery mode and run that command?? ;)

BlueSkyNIS
May 15th, 2008, 04:51 PM
Why not boot into recovery mode and run that command?? ;)

In that case the command would be:


chmod u+xs /usr/bin/sudo


Cheers ;)

unutbu
May 15th, 2008, 06:55 PM
In recovery mode you have to preface the chmod command with 'sudo'. His sudo is not working, so I sent him to the LiveCD.

amingv
May 15th, 2008, 07:02 PM
In recovery mode you have to preface the chmod command with 'sudo'. His sudo is not working, so I sent him to the LiveCD.

No, in recovery mode you get a root shell. You don't need to grant root privileges to root :).

unutbu
May 15th, 2008, 08:01 PM
Ah! You are right. Thanks.

conscious
May 15th, 2008, 09:00 PM
dmcgurk@dan:~$ sudo fdisk -1

You probably want to run
sudo fdisk -l with lowercase "L", not "one".

Oldsoldier2003
May 15th, 2008, 10:59 PM
You probably want to run
sudo fdisk -l with lowercase "L", not "one".

even so fdisk would have returned
fdisk: invalid option -- 1

Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISK List partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors

so that isn't the problem

Arthur Archnix
May 15th, 2008, 11:20 PM
Something like that might occur if you mounted your disks with the nosuid option in fstab. Maybe?