Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Root vs sudo gainroot

    Reply
    Page 2 of 3 | Prev |   1   2   3   | Next
    mdziaf | # 11 | 2011-01-10, 16:31 | Report

    Originally Posted by Mentalist Traceur View Post
    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.
    again, i doubt my girlfriend has any programs that requires root packages installed. She has only found out about Angry birds when I told her the day she got the phone (3days ago)...

    I am also confused to why it is prompting a password..it didnt happen on my n900 when I did mine..

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mdziaf | # 12 | 2011-01-10, 16:35 | Report

    [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?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    anapospastos | # 13 | 2011-01-10, 16:37 | Report

    First type root. After you 're root type passwd root and change the root password.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to anapospastos For This Useful Post:
    cheve

     
    mdziaf | # 14 | 2011-01-10, 16:51 | Report

    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).

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to mdziaf For This Useful Post:
    anapospastos

     
    geneven | # 15 | 2011-01-10, 17:11 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    zimon | # 16 | 2011-01-10, 17:19 | Report

    Originally Posted by Mentalist Traceur View Post
    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.
    There are other differences also.
    For example with "root" /root/.profile is run and you can for example have different $PATH than "normal" user.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to zimon For This Useful Post:
    Estel, Mentalist Traceur

     
    Mentalist Traceur | # 17 | 2011-01-10, 17:50 | Report

    Originally Posted by mdziaf View Post
    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?
    I should've clarified.

    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to Mentalist Traceur For This Useful Post:
    bigears5000, cheve, NokTokDaddy

     
    FRuMMaGe | # 18 | 2011-01-10, 17:57 | Report

    Originally Posted by mdziaf View Post
    However, if I close and reopen Xterminal, and type in
    Code:
    root
    no password prompt was given. but doing an apt-get install would give "unable to lock the admin directory"
    The lock error is because you still had app manager opened

    Edit | Forward | Quote | Quick Reply | Thanks

     
    mdziaf | # 19 | 2011-01-11, 05:56 | Report

    Originally Posted by Mentalist Traceur View Post
    I should've clarified.

    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.
    Thank you for the clarification regarding root and sudo gainroot. From what i understand, I shouldn't have a problem trying to do a apt-get install command when if I type in either right?

    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Char | # 20 | 2011-01-11, 07:35 | Report

    it's probably apt-worker trying to update
    run killall apt-worker, (after running root) and apt-get should work

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to Char For This Useful Post:
    cheve

     
    Page 2 of 3 | Prev |   1   2   3   | Next
vBulletin® Version 3.8.8
Normal Logout