maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   How can I solve this problem ? ?? Who could teach me ... (https://talk.maemo.org/showthread.php?t=81389)

pursueky 2012-01-06 07:06

How can I solve this problem ? ?? Who could teach me ...
 
BusyBox v1.19.3 (Debian 1.19.3power3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ root
sudo: must be setuid root
~ $ ls -l /usr/bin/sudo
-rwxr-xr-x 2 root root 90040 Apr 17 2009 /usr/bin/sudo
~ $ chown root:root /usr/bin/sudo
chown: /usr/bin/sudo: Operation not permitted
~ $ chmod 4755 /usr/bin/sudo
chmod: /usr/bin/sudo: Operation not permitted
~ $ reboot
-sh: reboot: not found

HtheB 2012-01-06 07:08

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by pursueky (Post 1146472)
BusyBox v1.19.3 (Debian 1.19.3power3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ root
sudo: must be setuid root
~ $ ls -l /usr/bin/sudo
-rwxr-xr-x 2 root root 90040 Apr 17 2009 /usr/bin/sudo
~ $ chown root:root /usr/bin/sudo
chown: /usr/bin/sudo: Operation not permitted
~ $ chmod 4755 /usr/bin/sudo
chmod: /usr/bin/sudo: Operation not permitted
~ $ reboot
-sh: reboot: not found

what does "sudo gainroot" do?

pursueky 2012-01-06 07:25

Re: How can I solve this problem ? ?? Who could teach me ...
 
BusyBox v1.19.3 (Debian 1.19.3power3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ sudo gainroot
sudo: must be setuid root

pursueky 2012-01-06 07:31

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by HtheB (Post 1146473)
what does "sudo gainroot" do?

Nothing else happened:


BusyBox v1.19.3 (Debian 1.19.3power3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ $ sudo gainroot
sudo: must be setuid root

michaaa62 2012-01-06 07:33

Re: How can I solve this problem ? ?? Who could teach me ...
 
What does the output give you?
Code:

apt-cache policy rootsh
Did you try to get rootsh reinstalled, remove it in some Application Manager, and later install it again?

pursueky 2012-01-06 07:43

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by michaaa62 (Post 1146479)
What does the output give you?
Code:

apt-cache policy rootsh
Did you try to get rootsh reinstalled, remove it in some Application Manager, and later install it again?

~ $ apt-cache policy rootsh
rootsh:
Installed: 1.8
Candidate: 1.8
Version table:
*** 1.8 0
500 http://repository.maemo.org fremantle/free Packages
100 /var/lib/dpkg/status
1.5 0
500 http://repository.maemo.org fremantle-1.3/free Packages
500 http://repository.maemo.org fremantle/free Packages
500 http://repository.maemo.org fremantle/free Packages
~ $

And neither the stock Application Manager nor Faster Application Manager work ...... I can't even open them .

michaaa62 2012-01-06 09:40

Re: How can I solve this problem ? ?? Who could teach me ...
 
You may shed some light by remembering, what you did recently before the error appeared.
Did you install something weird? Did you edit sudoers file http://wiki.maemo.org/Root_access#A_note_on_sudo? Did you follow some Howto floating around in the internet ?

Rob1n 2012-01-06 10:02

Re: How can I solve this problem ? ?? Who could teach me ...
 
If you have ssh installed & setup for root access, then you should be able to get on via that and reset the suid bit on /usr/bin/sudo. You could also try using "su" - I think you'll need to have set up a root password for that though. Otherwise I think you'll need to reflash. If sudo isn't set suid then there's no way for the applications to get root permissions in order to make any other changes.

pursueky 2012-01-06 10:45

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by michaaa62 (Post 1146505)
You may shed some light by remembering, what you did recently before the error appeared.
Did you install something weird? Did you edit sudoers file http://wiki.maemo.org/Root_access#A_note_on_sudo? Did you follow some Howto floating around in the internet ?

that 's what I did yesterday:
chmod -R 755 /usr/bin

Rob1n 2012-01-06 11:21

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by pursueky (Post 1146534)
that 's what I did yesterday:
chmod -R 755 /usr/bin

Yep, that'd do it - you reset the permissions on everything under /usr/bin, stripping off the SUID bit from sudo (and various others). I'd definitely suggest a reflash at this point (and avoiding running that command in future).

eight 2012-01-06 15:45

Re: How can I solve this problem ? ?? Who could teach me ...
 
Backupmenu is also a suggestion for situations like this. It only takes a few minutes to make a backup and you can restore the entire system if something goes wrong.

Hurrian 2012-01-06 22:06

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by pursueky (Post 1146534)
that 's what I did yesterday:
chmod -R 755 /usr/bin

Unless you have a very good reason to do so, never reset the permissions on system files. Reset them only when they won't execute, and even then, don't use the octal system. Just chmod +x.

pursueky 2012-01-06 23:37

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by eight (Post 1146672)
Backupmenu is also a suggestion for situations like this. It only takes a few minutes to make a backup and you can restore the entire system if something goes wrong.

But I can't install apps also can't remove any one.

woody14619 2012-01-07 00:05

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by pursueky (Post 1146870)
But I can't install apps also can't remove any one.

The concept is to have already installed BackupMenu, and made a backup. It's like saying "you should restore from backups" and you're saying "but I didn't do a backup". If you didn't already do a backup, you're pretty SOL. BackupMenu also would give you the option of mounting the whole file system directly on another machine, where you could then edit permissions on the raw files if you liked...

If you already have sshd installed, you may be able to get access that way, as suggested earlier. If not, maybe you'll luck out and something somewhere else has an suid-bit set you can exploit in some way. Try this command:

Code:

find / -perm -4000 -print
That may find something suid you can use to "break in" with? If you do manage to get in, you'll need to fix several files:

Code:

Nokia-N900-42-11:~/scripts# ls -l `find /usr/bin -perm -4000`
-rwsr-xr-x    1 root    root      /usr/bin/chfn
-rwsr-xr-x    1 root    root      /usr/bin/chsh
-rwsr-xr-x    1 root    root      /usr/bin/eapd
-rwsr-xr-x    1 root    root      /usr/bin/fusermount
-rwsr-xr-x    1 root    root      /usr/bin/gpasswd
-rwsr-xr-x    1 root    root      /usr/bin/gpg
-rwsr-xr-x    1 root    root      /usr/bin/hildon-sv-notification-daemon
-rwsr-xr-x    1 root    lpadmin  /usr/bin/lppasswd
-rwsr-xr-x    1 root    root        /usr/bin/mission-control
-rwsr-xr-x    1 root    root        /usr/bin/passwd
-r-sr-sr-x    1 root    root        /usr/bin/pnatd
-rwsr-xr-x    1 root    root        /usr/bin/rclockd
-rwsr-xr-x    2 root    root      /usr/bin/sudo
-rwsr-xr-x    2 root    root      /usr/bin/sudoedit

Edit: One thing of note, /bin/su would be unaffected by this. So if you have set a root password (via sshd or sudo in the past), you should still be able to use /bin/su - to change to root and fix things that way.

Estel 2012-01-07 00:09

Re: How can I solve this problem ? ?? Who could teach me ...
 
Rescue OS (search forum) is also and idea, for people that haven't installed backupmenu.

Just out of curiosity - may I ask, why You decided to execute so ridiculous command? I admit that it's better than rm -r /, but i still can't see any sane reasons to even think about that,

/Estel

michaaa62 2012-01-07 10:38

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Edit: One thing of note, /bin/su would be unaffected by this. So if you have set a root password (via sshd or sudo in the past), you should still be able to use /bin/su - to change to root and fix things that way.
su is not set suid per default. It was never meant to be used :(

Please stop complaining about what you have not installed, just answer the questions about what actually is installed to gain the rights of root. If non of the methods you were asked before in this thread are installed, go to the wiki page about reflashing http://wiki.maemo.org/Updating_the_tablet_firmware

pursueky 2012-01-07 11:19

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by Estel (Post 1146878)
Rescue OS (search forum) is also and idea, for people that haven't installed backupmenu.

Just out of curiosity - may I ask, why You decided to execute so ridiculous command? I admit that it's better than rm -r /, but i still can't see any sane reasons to even think about that,

/Estel

To install GoAgent in my N900
and it needs to do
python2.6 xx
so I chmod the whole dir.

woody14619 2012-01-10 03:14

Re: How can I solve this problem ? ?? Who could teach me ...
 
Quote:

Originally Posted by michaaa62 (Post 1147018)
su is not set suid per default. It was never meant to be used :(

Hmmm... really? It's suid on my device, and I don't recall setting it that way. But it's more than possible I did set it long ago. I've only had to reflash twice, and that was really early on when playing with some of the early kernel hacks. (And once of those was just to reflash the kernel.)

Outside of that, only about 3 other files on my device are suid, and none of them are anything you can use to break in. All the more reason to install BackupMenu and/or sshd right from the get-go on a new system.


All times are GMT. The time now is 08:00.

vBulletin® Version 3.8.8