Announcement

Collapse
No announcement yet.

How to Obtain root Privileges?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to Obtain root Privileges?

    How to obtain root privileges?
    How can I log in as root?

    #2
    Re: How to Obtain root Privileges?

    in *buntu linux root (super user) privileges can be obtained by typing sudo before a command.

    e.g.
    if you type "dolphin" in konsole. it will open dolphin file manager with normal rights.
    but if you type "sudo dolphin" it will ask for the root password and you will open dolphin as a root.

    i don't think you can login as root. maybe..cause i never need to
    asus A52N
    Dual boot: Kubuntu 11.10 64bit, Ubuntu 11.10 64bit
    AMD Athlon II 64 X2 | 4 GB DDR3 RAM | ATI Radeon HD 4200
    windoze free since 2009 12 16 (Vijay din= Victory day)

    Comment


      #3
      Re: How to Obtain root Privileges?

      I'll elaborate a bit:

      The root account is locked in *buntus by default, and the system is designed to run without it, using sudo instead.

      To perform administrative (root) actions, use:

      1. to run a command as root:
      Code:
      sudo command
      (ex. sudo cp foo bar)

      2. to open a root terminal:
      Code:
      sudo -i
      3. to open a GUI app as root (in kde):
      Code:
      kdesudo program
      (ex. kdesudo dolphin)

      More information can be found here https://help.ubuntu.com/community/RootSudo
      (the page is meant for ubuntu so it uses mainly gksudo [for gnome] instead of kdesudo)

      The page also explains how to enable the root account if you have a good reason to do so and know what you're doing...but this is usually neither necessary nor recommended.

      EDIT:
      An additional note:
      By default, only the first user created during installation is authorized to use sudo, if you want to give additional users admin privileges, you need to add those users to the 'admin' group

      Comment


        #4
        Re: How to Obtain root Privileges?

        i forgot that to open GUI app...one needs to use kdesudo.
        thanks for correcting kubicle : )
        asus A52N
        Dual boot: Kubuntu 11.10 64bit, Ubuntu 11.10 64bit
        AMD Athlon II 64 X2 | 4 GB DDR3 RAM | ATI Radeon HD 4200
        windoze free since 2009 12 16 (Vijay din= Victory day)

        Comment


          #5
          Re: How to Obtain root Privileges?

          Allthough you don't need root priveliges, you can su to root by typing: sudo passwd
          Enter your own password and then enter your "new" root password. Re-enter the password.

          You can now su -


          :-)

          Comment


            #6
            Re: How to Obtain root Privileges?

            There is little, if any, need to activate a root password, and I advise against it.

            It can open your system up to a direct remote root attack. Also, be careful of using "su" because improper use can result in running root commands with your account environment, which can and probably would lead to a permissions disaster. Consult "man su" for more details.
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment


              #7
              Re: How to Obtain root Privileges?

              From the Ubuntu Documentation:

              Logging in to X as root may cause very serious trouble. If you believe you need a root account to perform a certain action, please consult the official support channels first, to make sure there is not a better alternative.
              In short: Don't do it, there's no reason to anyway.

              Use sudo at the command line to have root priveledge for a non-graphical (command line) program and kdesudo for graphical interface program. Many root functions (file editing and copying and the like) can be done within Dolphin by install the Root Actions Service Menu


              Please Read Me

              Comment


                #8
                Re: How to Obtain root Privileges?

                Originally posted by mobruu
                Allthough you don't need root priveliges, you can su to root by typing: sudo passwd
                Enter your own password and then enter your "new" root password. Re-enter the password.
                I know you're just answering a direct question, but I'd recommend not posting "one-liner" instructions to enable the root account. The information can be found on the wiki page I linked to, with detailed information on sudo and pros and cons of enabling the root account.

                While most people (especially those coming from other distributions) are familiar with the root concept, there are also people reading these forums that might not fully understand what they're doing and how it affects the system as a whole.

                Originally posted by mobruu
                You can now su -
                'sudo -i' will do the same as 'su -'

                Originally posted by GreyGeek
                It can open your system up to a direct remote root attack.
                That's a somewhat smaller risk than usually thought of, most (if not all) services disable root logins by default even if root account is enabled. It's still unnecessary in most (if not all) cases, of course.

                Also, be careful of using "su" because improper use can result in running root commands with your account environment
                That's probably why he used "su -", but otherwise I agree, especially as "sudo -i" does the same thing.

                Originally posted by oshunluvr
                Logging in to X as root may cause very serious trouble. If you believe you need a root account to perform a certain action, please consult the official support channels first, to make sure there is not a better alternative.
                There is a difference between enabling the root account and running X as root, but otherwise I agree

                Comment


                  #9
                  Re: How to Obtain root Privileges?

                  Don't listen to the nanny goats that say never to log in as root.

                  It's just as dangerous to do stuff with sudo, since whenever you do anything with sudo your actions have temporary root privileges anyway.

                  The main reason to use sudo is so that you don't forget to stop doing things as root.

                  If you are in the habit of being the root user, you will eventually forget to return to a normally-privileged user status, and when you remain logged in as the root user, your system is relatively vulnerable. If you are diligent about logging in as root user for very circumscribed tasks and then logging out, however, it is no different than using sudo.

                  It is exceedingly rare that I do anything while logged in as the root user. However, when I am doing a lot of system maintenance, migrating systems, or scripting many steps all of which must be done with root privileges, I sometimes do it to avoid having to prefix every command with "sudo," which can become tedious.

                  To log in as the root user, you ought to set a password for the root user, first.

                  sudo passwd root

                  Then you can merely become root (using your new password):

                  su

                  If you want to become the root user without setting a root password (but using your regular user's sudo password), you can do that:

                  sudo su

                  or

                  sudo -s

                  My recommendation is that every user set a password for the root account (sudo passwd root), because if it isn't done, then any casual passerby with physical access to the computer can set the root password and then become root (if they are the first ones to attempt to set the password).

                  Better to do it yourself before someone else does. "Ostriches make poor security advisors."

                  UbuntuGuide/KubuntuGuide

                  Right now the killer is being surrounded by a web of deduction, forensic science,
                  and the latest in technology such as two-way radios and e-mail.

                  Comment


                    #10
                    Re: How to Obtain root Privileges?

                    Originally posted by perspectoff
                    It's just as dangerous to do stuff with sudo, since whenever you do anything with sudo your actions have temporary root privileges anyway.
                    In a terminal there's not much difference, but logging into a graphical environment as root is a another thing. (simple things like software bugs, vulnerabilities, typos and misclicks are usually much more destructive if everything is running as root...some people are willing to live with the risk, but that's not a reason to recommend it to everyone)

                    It is exceedingly rare that I do anything while logged in as the root user. However, when I am doing a lot of system maintenance, migrating systems, or scripting many steps all of which must be done with root privileges, I sometimes do it to avoid having to prefix every command with "sudo," which can become tedious.
                    That's why there is 'sudo -i'

                    If you want to become the root user without setting a root password (but using your regular user's sudo password), you can do that:
                    sudo su
                    or
                    sudo -s
                    sudo -s is usually a bad idea, it runs a mixed root environment with certain key environment variables like $HOME set as the regular user...this will lead to problems eventually (depending on what you're doing in the shell)...sudo -i will give a true root shell with root environment.

                    My recommendation is that every user set a password for the root account (sudo passwd root)
                    Everyone is free to do what they wish, but recommending it to others is another thing completely.

                    because if it isn't done, then any casual passerby with physical access to the computer can set the root password and then become root (if they are the first ones to attempt to set the password).
                    Casual passerby with physical access can do that anyway, whether you set a root password or not...a root password will not protect the machine, unless several other steps are taken to secure the machine as well (simply booting with init=/bin/bash will give a passerby a root shell without any password prompts whether root password is set or not).

                    Comment


                      #11
                      Re: How to Obtain root Privileges?

                      Everyone is free to do what they wish, but recommending it to others is another thing completely.
                      I don't really see why this is the case.
                      If someone asks me what would be the best way to totally screw up his system, then who am I to stand his his way?
                      After all it's just an OS you could re-install in a half hour
                      It's not like he's asking for the best way to commit suicide or something.

                      I never understood this mentality. I used to belong to another distro"s forum, where people absolutely would not tell someone how to compile stuff. No matter how much they asked.

                      I think as long as you explain the pitfalls of doing certain things a certain way, then it should be up to the individual to make up his/her mind whether they are willing to take the risks involved, or go do some reading up.

                      Comment


                        #12
                        Re: How to Obtain root Privileges?

                        Originally posted by sixthwheel
                        Everyone is free to do what they wish, but recommending it to others is another thing completely.
                        I don't really see why this is the case.
                        If someone asks me what would be the best way to totally screw up his system, then who am I to stand his his way?
                        Umm....I don't see how you got that from what I said. You might not wish to stand in his way...but would you really recommend it to others? or would you post commands that "totally screw up his system" on a public forum with thousands of readers of varying levels of experience?

                        For the record, I do not consider enabling the root account necessarily bad...it makes sense in some use cases, but is completely unnecessary in others.

                        You also have to consider that the OP didn't ask "How to enable the root account?", but "How to obtain root privileges?" (short and simple answer sudo) and "How can I log in as root?" (short and simple answer sudo -i), the link to instructions (with additional information) to enable the root account was just an "in-case-you-were-looking-for-this" information.

                        I think as long as you explain the pitfalls of doing certain things a certain way, then it should be up to the individual to make up his/her mind whether they are willing to take the risks involved, or go do some reading up.
                        I think I did that in my first post.

                        Comment

                        Working...
                        X