![]() |
Root vs sudo gainroot
Hi there,
I am trying to root my friend's N900 to install preenv. The following describes the method I used and the problem I faced trying while trying to root the device. 1. I installed the rootsh application on the N900 2. Restarted the phone (don't know if it was necessary but did it anyways) 3. Opened XTerminal, and typed in Code:
sudo gainroot However, if I close and reopen Xterminal, and type in Code:
root I'm quite new to the linux world, but theres a few questions that is on my mind.
I also tried uninstalling rootsh through the app manager but it returned stating that rootsh was unable to uninstall. Any help and explanation is appreciated. Thanx :) __ First thread, and 2nd post in forum :o, I hope I was clear about my query. I've also searched the forums, tried doing a Code:
sudo passwrd root |
Re: Root vs sudo gainroot
Quote:
|
Re: Root vs sudo gainroot
Warning, wild guess ahead: Did you install some other root-enabling package like sudser, open-ssh or other before, so that sudo gets modified somehow to ask for a password?
|
Re: Root vs sudo gainroot
@michaaa62
I probably feel he installed open ssh because that is the only one that asks for a password i think. |
Re: Root vs sudo gainroot
Quote:
|
Re: Root vs sudo gainroot
try sudo su. And sudo gainroot only works when your phone is in RD mode.
|
Re: Root vs sudo gainroot
I'm guessing he has that other root package already installed. I never get sudo gainroot asking for a password.
Either way, only difference is root puts you in the /root directory. You can probably just use "root", then run "passwd root" (without the sudo, since you'd be root already) that way. But I wouldn't be doing that for another person's N900, unless they've made it very clear that they're okay with you doing it. - Edit - "sudo gainroot" works just fine without RD mode. Just installing rootsh enables it. |
Re: Root vs sudo gainroot
Quote:
Quote:
|
Re: Root vs sudo gainroot
Quote:
just out of curiosity,what do you mean by the phone is in RD mode? |
Re: Root vs sudo gainroot
Quote:
|
Re: Root vs sudo gainroot
Quote:
I am also confused to why it is prompting a password..it didnt happen on my n900 when I did mine.. |
Re: Root vs sudo gainroot
[QUOTE=Either way, only difference is root puts you in the /root directory. You can probably just use "root", then run "passwd root" (without the sudo, since you'd be root already) that way.
[/QUOTE] so what you are saying is that if i typed in root and then passwd root, it should give me the same effect as typing in sudo gainroot? im sorry if this is a stupid question, but if root just puts me to the root folder, then what does sudo gainroot actually do? |
Re: Root vs sudo gainroot
First type root. After you 're root type passwd root and change the root password.
|
Re: Root vs sudo gainroot
Thank you for the suggestion. I will update you guys how it goes. the N900 in question has gone to sleep (its wayyyyy past midnight here now).
|
Re: Root vs sudo gainroot
The command "root" just runs "sudo gainroot", last I heard.
If you type cat /usr/bin/root in the terminal, you can see exactly what typing "root" does. Try it. Error messages like "unable to lock the admin directory" often just mean that you have app mgr open in some other window and you've forgotten about it. |
Re: Root vs sudo gainroot
Quote:
For example with "root" /root/.profile is run and you can for example have different $PATH than "normal" user. |
Re: Root vs sudo gainroot
Quote:
Both "sudo gainroot" and "root" elevate that X-Terminal window to the root user. But, if you run "sudo gainroot", you become the root user, but you stay in the same directory you had terminal pointed to before. So, say you type "cd /usr/bin". If you type "sudo gainroot", you will become the root user, and that X-Term window will still be in /usr/bin. However, if you instead type "root", it will make you root user, then it will do what zimon says (which I didn't know about), but it will change the directory you're in to "/root". So if you're in /usr/bin and type "sudo gainroot", the visible end result is you get root access, and the directory you're in is still /usr/bin. If you're in /usr/bin, and type "root", the visible end result (unless you have custom stuff in /root/.profile) is you end up in the folder /root, and get root access. For this reason, I use "sudo gainroot", because I've never needed/wanted to fiddle with the $PATH settings to point me somewhere else, and if I'm gaining root access, I usually have already navigated to the directory I want to be in - which means having to renavigate there from /root is at least one more extra command. Whenever I need something in my path, I just move or symlink it into one of the four directories that are in the standard paths. (/bin, /sbin, /usr/bin, /usr/sbin), so it works out for me. But it's a matter of personal preference. If there's something you can do more effectively by changing /root/.profile, then "root" is good for you. Anyway, if you say she hasn't installed anything else herself that would give root access, I really don't know why sudo gainroot keeps asking for a password. It SHOULD be something you can edit in /etc/sudoers though... Question, did you install rootsh from Extras? Or the one in Extras-Devel? (Both are almost the same, but have some key differences... which might be why you're having sudo gainroot ask for a password.) If you're not sure, see if you can run "rootsh passwd root", or "rootsh [other command requiring root permissions]". I believe that functionality was in the Extras version of rootsh, but was removed from the version that's in devel now. anapospastos already answered the other part of your question. "root" will make you root user (while changing your directory to /root, which doesn't actually do anything other than possibly make you have to type a couple more cd commands or use different relative paths when running commands) [and runs the root/.profile, but that's irrelevant to this], and then passwd root will let you change the root password, without asking you for that password like "sudo" will. |
Re: Root vs sudo gainroot
Quote:
|
Re: Root vs sudo gainroot
Quote:
But why is it that I am unable to download and install preenv, after typing root. It gives "unable to lock the admin directory". @FruMMAGe, We have restarted the phone, and opened up only xterminal without opening the app manager and is till gave the same "unable to lock the admin directory" Again many thanx for the explanation and help :) |
Re: Root vs sudo gainroot
it's probably apt-worker trying to update
run killall apt-worker, (after running root) and apt-get should work |
Re: Root vs sudo gainroot
Quote:
|
Re: Root vs sudo gainroot
Quote:
|
Re: Root vs sudo gainroot
Quote:
The "sudo gainroot" shouldn't be asking for a password though, so the next thing to do is check whether the sudoers entry is correct - what's the result of running (as root) the following?: Code:
grep gainroot /etc/sudoers.d/01sudo Code:
lsof /var/lib/dpkg/lock |
Re: Root vs sudo gainroot
Quote:
|
Re: Root vs sudo gainroot
Quote:
Code:
BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash) |
Re: Root vs sudo gainroot
Quote:
Code:
grep gainroot /etc/sudoers |
Re: Root vs sudo gainroot
Quote:
Again many thanx to everyone for your help :D Appreciate it a lot :D |
Re: Root vs sudo gainroot
Quote:
|
All times are GMT. The time now is 01:08. |
vBulletin® Version 3.8.8