Forum
[Solved] user is not allowed to execute as root - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Installation (/forum-16.html)
+--- Thread: [Solved] user is not allowed to execute as root (/thread-1141.html)

Pages: 1 2


[Solved] user is not allowed to execute as root - ah0b0 - 25th Jul, 2013 03:10 AM

o/

Not sure where to put this so I put it in Installation.
Running Xbian 1 beta 1
Was going fine. Installed samba and some other programs through SSH. I got to a point where I wanted to backup my SD.

At the time I didn't know a way to backup in linux -- so I shutdown properly (sudo shutdown -h now) and once it was done, removed power and removed SD card. Plugged the sd into windows7 box and it pops up to try to "Scan and fix the SD Card" or to continue without scanning. I decided to continue without scanning. Ran a "read" on Win32DiskImager. Backup was complete. Ejected and put in pi -- powered up pi. Now trying to run a simple command : sudo apt-get update

I get this error:
Code:
xbian@Link ~ $ sudo apt-get update
[sudo] password for xbian:
Sorry, user xbian is not allowed to execute '/usr/bin/apt-get update' as root on Link.
xbian@Link ~ $

Now any command with sudo will return a similar error. Even sudo reboot.
Now "su" works fine and I opened visudo and everything looks fine.

TL;DR - Was working fine. Shutdown, removed sd card, backed up in win7, put back in pi and booted. Now Sudo won't work.


RE: user is not allowed to execute as root - IriDium - 25th Jul, 2013 03:32 AM

Don't multiple post: Raspberry.org

Check /etc/sudoers
It should look like this: sudoers

Also post your dmesg via pastebin as defined in the "read me first"

sudo poweroff is the preferred shutdown command instead of shutdown.


RE: user is not allowed to execute as root - ah0b0 - 25th Jul, 2013 04:48 AM

(25th Jul, 2013 03:32 AM)IriDium Wrote:  Don't multiple post: Raspberry.org

Check /etc/sudoers
It should look like this: sudoers

Also post your dmesg via pastebin as defined in the "read me first"

sudo poweroff is the preferred shutdown command instead of shutdown.

surely --

XBian version: 1.0Beta1.1
Is your system Overclocked: No. Set to Defaults.
What is your power supply power rating: 1000ma 5v
Do you have any device connected to USB ports of RPi ? Powered USB hub w/ 2.5 SATA hdd -- irrelevent
How is your RPi connected to the network ? LAN
What SD Card you using ? Sony SDHC 8gb Class 10 UHS-1 SF8UY

Dmesg: http://pastebin.com/Yn5T7rY9
XBMC.log: http://pastebin.com/7UupQVec
---------------------------------------------------------------------------------------------------------------------------------

Some new developments are:

My generic usb keyboard will not work (though it looks recognized)
And the network connection will randomly close on the rpi (no lights for network) forcing a hard-power off.
Usually it will close the connection within the first 5 minutes.


Re: user is not allowed to execute as root - rikardo1979 - 25th Jul, 2013 05:07 AM

use to have had same issues and after two weeks of pulling my hair of I found it was caused by USB cable from PSU.I use same PSU with different cable and no issues.
Worth to try


Re: RE: user is not allowed to execute as root - f1vefour - 25th Jul, 2013 08:18 AM

(25th Jul, 2013 05:07 AM)rikardo1979 Wrote:  use to have had same issues and after two weeks of pulling my hair of I found it was caused by USB cable from PSU.I use same PSU with different cable and no issues.
Worth to try

+1

These new issues definitely sound like a power issue.

Check the /etc/sudoers as mentioned.

Unplug the powered hub and all accessories (except keyboard) including the LAN cable and see if your Pi will allow you to run 'sudo ls'.

If no, unplug the keyboard and plug in the LAN cable and try sudo over SSH. If still no sudo, reboot (still no accessories except LAN) and SSH in and try sudo one last time.

It may be a hardware conflict with the keyboard or a button on the keyboard is stuck (flip it over and tap it against something).


RE: user is not allowed to execute as root - ah0b0 - 25th Jul, 2013 02:05 PM

Quote:+1

These new issues definitely sound like a power issue.

Check the /etc/sudoers as mentioned.

Unplug the powered hub and all accessories (except keyboard) including the LAN cable and see if your Pi will allow you to run 'sudo ls'.

If no, unplug the keyboard and plug in the LAN cable and try sudo over SSH. If still no sudo, reboot (still no accessories except LAN) and SSH in and try sudo one last time.

It may be a hardware conflict with the keyboard or a button on the keyboard is stuck (flip it over and tap it against something).

Sudoers looks fine. I even copied and pasted it from pastebin. Still same issues. Changed power cable as rikardo1979 said.

Went into root and removed sudo. Rebooted. Installed sudo again. Still same issues.

I even went to the store, returned the Rpi, usb hub and sd card and got new ones and a new usb hub that is on this list: http://elinux.org/RPi_VerifiedPeripherals

Installed a fresh xbian1.1. Was working fine again until I ran dd and tried to backup the sdcard. SSH froze and wouldn't connect. Same with Samba. Though, xbmc on the tv still worked so I rebooted it from there using my keyboard. (The LED on the hdd i was backing up to had stopped blinking for about 20 min.) Now after the reboot, sudo acted up again with the same issue.

Tried shutting down and unplugged everything except ethernet. It just wouldn't load... Added monitor/hdmi and it still wouldn't load... Did the same: hdmi, eth0, and keyboard and it's stuck at the splash screen at "loading..." -- Now, I remembered I have a hdd mounted in fstab. Put a # in front of that line, and then it would finally boot -- but the keyboard won't work... Keyboard #2 doesn't work either. Tried plugging rpi power into usb hub. Still no keyboard(s).

As for: "Unplug the powered hub and all accessories (except keyboard) including the LAN cable and see if your Pi will allow you to run 'sudo ls'." I don't know how to do that: 1) get xbmc to go away to a terminal and 2) get a keyboard to work.

Here is what pulls up for sudo -l
Code:
$ sudo -l
Matching Defaults entries for xbian on this host:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin

User xbian may run the following commands on this host:
    (ALL) NOPASSWD: /usr/local/sbin/xbian-config, (ALL) /sbin/halt, (ALL)
    /sbin/reboot, (ALL) /usr/bin/splash

I'm really at a loss. I'd start a new image but it seems to keep happening anytime I ... blink or whatever.

Things I've ruled out: (please correct me if I'm wrong)
faulty raspberry pi, faulty keyboard, faulty usb hub, sudo installation, sudoers config file.

Any other suggestions? Undecided


Re: user is not allowed to execute as root - f1vefour - 25th Jul, 2013 02:19 PM

You could try installing alpha5, verify it works correctly and follow the upgrade path to beta1.1.

This is not optimal but if your interested in a functional system and not debugging issues (which it seems you are from the new hardware) this would be my next step.

Looking at your previous dmesg I see an issue with your keyboard, there are currently various USB issues being worked on with several patches (some experimental) being added recently. I'm not sure if the Xbian kernel uses these patches but if so this may be related.

You said you were mounting a hard drive, did you put this entry in fstab?


Solved : user is not allowed to execute as root - ah0b0 - 25th Jul, 2013 11:17 PM

(25th Jul, 2013 02:19 PM)f1vefour Wrote:  You could try installing alpha5, verify it works correctly and follow the upgrade path to beta1.1.

This is not optimal but if your interested in a functional system and not debugging issues (which it seems you are from the new hardware) this would be my next step.

Looking at your previous dmesg I see an issue with your keyboard, there are currently various USB issues being worked on with several patches (some experimental) being added recently. I'm not sure if the Xbian kernel uses these patches but if so this may be related.

You said you were mounting a hard drive, did you put this entry in fstab?

Thanks for the suggestion. I may try it again -- last time i tried Alpha5 it gave me a whole lot more problems than I care to tend to. I may look into the keyboard patches if I'm feeling adventurous.

As for sudo, I got that fixed. The line at the bottom of visudo should read xbian ALL=(ALL:ALL) ALL
As for the keyboard not working, I don't care as much as long as I have ssh and my android remote works. So I'm good to go. Thanks all.

Cheers Big Grin


RE: user is not allowed to execute as root - rikardo1979 - 25th Jul, 2013 11:36 PM

is your new HW exact same as before or did you pick different accessories ( especially PSU+USB cable if separate, USB Hub,etc) ?


RE: user is not allowed to execute as root - IriDium - 26th Jul, 2013 01:45 AM

This article is related to "user is not allowed to execute as root".

I believe that has been solved - for whatever reason.

Can we say this issue has been solved, and if you still have other problems, to reopen a new discussion.

It makes it easier for everyone to follow the threads.


Re: RE: user is not allowed to execute as root - f1vefour - 26th Jul, 2013 01:57 AM

(26th Jul, 2013 01:45 AM)IriDium Wrote:  This article is related to "user is not allowed to execute as root".

I believe that has been solved - for whatever reason.

Can we say this issue has been solved, and if you still have other problems, to reopen a new discussion.

It makes it easier for everyone to follow the threads.

It's been solved, why it happened hasn't.


RE: user is not allowed to execute as root - IriDium - 26th Jul, 2013 02:32 AM

(26th Jul, 2013 01:57 AM)f1vefour Wrote:  
(26th Jul, 2013 01:45 AM)IriDium Wrote:  This article is related to "user is not allowed to execute as root".

I believe that has been solved - for whatever reason.

Can we say this issue has been solved, and if you still have other problems, to reopen a new discussion.

It makes it easier for everyone to follow the threads.

It's been solved, why it happened hasn't.

Most likely candidate is samba modifying the sudoers file. Even though the file was copied copied from my pastebin.

If anyone has a test machine can they install samba and see what the sudoers file looks like.


Re: user is not allowed to execute as root - f1vefour - 26th Jul, 2013 03:00 AM

Something that should definitely be fixed, where are bug reports filed?


RE: user is not allowed to execute as root - ah0b0 - 26th Jul, 2013 03:14 AM

Fresh boot of Xbian1 beta 1.1.
Here is the sudoers file just after installation: http://pastebin.com/Jjr19GkN
You can see why I was confused.
I installed samba and tried sudo after. It still works fine. I'll continue with all the steps that I did before to try to see when sudo broke.


RE: user is not allowed to execute as root - ah0b0 - 26th Jul, 2013 04:25 AM

Got it. User error (i think).
I made a user group "torrent" and tried to add xbian to it but accidentally left out the " -a " tag to append it, so I guess it kicked it out of the sudo group.
Tried adding it back to the sudo group and it didn't fix it.

Ran # usermod -G sudo,xbian xbian and that got me sudo working again but now my gid is sudo not xbian like it was at the fresh install...

So I tried to change that and I did $ sudo usermod -g xbian xbian and the ID now returns "uid=1001(xbian) gid=1001(xbian) groups=1001(xbian),27(sudo)".
................................................................................​....
Did a fresh install again. Here is the return for "id xbian"..
Code:
uid=1001(xbian) gid=1001(xbian) groups=1001(xbian),27(sudo),999(input)