Results 1 to 6 of 6

Thread: General Query Root User

  1. #1
    Join Date
    Apr 2013
    Beans
    7

    Question General Query Root User

    I'm following the course activities given by the Open University covering Linux. They tell you how to become a root user etc. with sudo su. But how do you come out off the root ? Can anyone help? Plus can anyone recommend a book that I can read and learn more about Linux? Thank you in advance
    Last edited by awatkins1971; April 15th, 2013 at 05:06 PM.

  2. #2
    Join Date
    Nov 2007
    Location
    Wisconsin
    Beans
    1,139

    Re: General Query Root User

    Quote Originally Posted by awatkins1971 View Post
    But how do you come out off the root ?
    Use the command 'exit' to return to a non-root shell prompt ($).

    However, I have used Ubuntu for seven years, and use sudo very frequently. I use root regularly in Debian and other distros.
    I have *never* needed to use root in Ubuntu, and strongly discourage it.

  3. #3
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: General Query Root User

    Just to make it clear. If you have sudo rights to start a root shell, then you should use
    Code:
    sudo -i
    to start one. Iif not, but (there is and) you know the root password, then you should use
    Code:
    su -
    Please read community/RootSudo

    You can log out from a root (or any other) shell with the `exit' command or by pressing Ctrl+d (assuming that your shell dandles them).

    In Ubuntu, the `admin' users (like the first user created during installation) have full sudo rights, which means that they can use sudo to run any command as root or any other user. So, most of the time you don't need to start a root shell, because you are able to run a single command as root with sudo.

    BTW, Welcome to the forums!

    HTH
    Last edited by sisco311; April 14th, 2013 at 10:01 PM.

  4. #4
    Join Date
    Feb 2008
    Beans
    60

    Re: General Query Root User

    If you are root all you have to do is "su username" will take you back to user!

  5. #5
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: General Query Root User

    Quote Originally Posted by zrdc28 View Post
    If you are root all you have to do is "su username" will take you back to user!
    Not true. The original shell is still open. When you su username, you open a new shell. So now you have 3 shells open (username, root, username). Exit is the proper way to close an open shell.
    -BAB1

  6. #6
    Join Date
    Jun 2008
    Location
    Singapore
    Beans
    42
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: General Query Root User

    Quote Originally Posted by bab1 View Post
    Not true. The original shell is still open. When you su username, you open a new shell. So now you have 3 shells open (username, root, username). Exit is the proper way to close an open shell.
    Agreed. In fact , doing that is very dangerous for production servers because the next person who uses the console might log out of the shell to find out that he/she automatically landed in a root shell! Best would be to exit or ctrl-d.
    Loco Team Contact
    Launchpad : https://launchpad.net/~ubuntu-sg-team
    Loco Website : http://ubuntu.sg

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •