Active Topics

 


Reply
Thread Tools
Posts: 108 | Thanked: 44 times | Joined on Nov 2009 @ Como, Italy
#1
Hey everyone,

I've installed rootsh to mess around a bit. However, I realized that its been more than 6 years since I've used linux extensively, and I don't want to make my n900 a test device for that.

I tried to uninstall rootsh, but the uninstall does not work.

The quetion is how can I disable the root access now?

I've searched extensively but was unable to find an answer.
__________________
computer 1st, phone 2nd
 

The Following User Says Thank You to smage For This Useful Post:
Posts: 716 | Thanked: 303 times | Joined on Sep 2009 @ Sheffield, UK
#2
Just dont use it. Its not like it permanently locks you in a root shell, you have to explicitly ask to become root.
__________________
http://www.speedtest.net/result/877713446.png

My Websites
CSD Projects - Flickr - UAE4Maemo (UAE4All Compatibility List)

Favourite N900 Applications
Picodrive - UAE4All

Please post your UAE4All compatibility reports. Even better, post them to my UAE4Maemo site!
Not sure how UAE4All works such as mouse emulation? Read the FAQ.
 
Posts: 108 | Thanked: 44 times | Joined on Nov 2009 @ Como, Italy
#3
yeah that's true, until a curious friend or relative bricks it :P
__________________
computer 1st, phone 2nd
 
Posts: 303 | Thanked: 175 times | Joined on Oct 2009 @ London UK
#4
To be fair, a non-root user could still cause some nasty damage..

Assuming the rootsh package was used. The postinst script (which is run as part of the package installation) is:

#!/bin/sh -e

cp /usr/sbin/gainroot /usr/sbin/gainroot.old
echo '
#!/bin/sh
#From Andrey Gubarev easyroot.
trap exit SIGHUP SIGINT SIGTERM
PATH=/bin:/usr/bin:/sbin:/usr/sbin
if [ "$1" = "--use-su" ]
then
exec su -
else
echo "Root shell enabled"
/bin/sh
fi
' > /usr/sbin/gainroot
chmod 4755 /usr/bin/rootsh
exit 0

It seems that the package replaces the gainroot file in /usr/sbin
But the prerm script (which is called when the package is removed) does:

mv /usr/sbin/gainroot.old /usr/sbin/gainroot


But only if /usr/sbin/gainroot is executable..

try the following:

[ -x /usr/sbin/gainroot.old ] && echo "yeah, it is"

If it is executable, removing the package should remove root access.. If it isn't executable, the cp line in the postinst script is wrong.. it should be cp -p to ensure executable flags are copied too..

long and short, removing the rootsh package should remove root access via sudo gainroot
 

The Following User Says Thank You to cpitchford For This Useful Post:
Posts: 108 | Thanked: 44 times | Joined on Nov 2009 @ Como, Italy
#5
I wasn't able to execute the script any other suggestions?
__________________
computer 1st, phone 2nd
 
Posts: 303 | Thanked: 175 times | Joined on Oct 2009 @ London UK
#6
Originally Posted by smage View Post
I wasn't able to execute the script any other suggestions?
That is a bit freaky!

On my device, the gainroot.old file (created with rootsh is installed) is executable..

Try this..
uninstall rootsh using package manager

sudo gainroot
(which is apparently still working, if not.. job done! )

dpkg -l |grep rootsh
(make sure it isn't installed anymore)

chmod 755 /usr/sbin/gainroot.old
chown root:root /usr/sbin/gainroot.old
mv /usr/sbin/gainroot.old /usr/sbin/gainroot

exit

that'll probably do it!

Can't see a reason why it wouldn't uninstall sucessfully! I still think the cp in the install script should be cp -p, but there you go!
 

The Following User Says Thank You to cpitchford For This Useful Post:
Posts: 248 | Thanked: 72 times | Joined on Oct 2009
#7
OT: is it me or is this programming language and stuff major boring *****?

i mean i am not dumb but seriously. its just friggin letters and symbols and combinations of it. i study math, which is quite the same actually. just dont see why i am doing that. and reading the coding stuff. cant get there with my mind.
 
Posts: 108 | Thanked: 44 times | Joined on Nov 2009 @ Como, Italy
#8
using the package manager I get the message: Unable to uninstall 'rootsh'
__________________
computer 1st, phone 2nd
 
Posts: 1,208 | Thanked: 1,028 times | Joined on Oct 2007
#9
Post the log from application manager here. And what does "I wasn't able to execute the script" mean anyway?
 
Posts: 108 | Thanked: 44 times | Joined on Nov 2009 @ Como, Italy
#10
ok

sudo gainroot
(which is apparently still working, if not.. job done! )
- this one still works

dpkg -l |grep rootsh
(make sure it isn't installed anymore)
- it's still installed

chmod 755 /usr/sbin/gainroot.old
chown root:root /usr/sbin/gainroot.old
mv /usr/sbin/gainroot.old /usr/sbin/gainroot
I run these and the old file is replaced. However, rootsh is still installed and even after a device restart I'm still able to gain root. Also in the package manager, rootsh is still shown as installe.
__________________
computer 1st, phone 2nd
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:50.