Find the answer to your Linux question:
Results 1 to 9 of 9
I'm fairly new to Ubuntu, and one of the things I don't like about it is the fixation of avoiding root login. I read in the sticky post at the ...
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    5

    Why is 'sudo' better than logging in as root?

    I'm fairly new to Ubuntu, and one of the things I don't like about it is the fixation of avoiding root login. I read in the sticky post at the top of this forum that logging into a GUI interface as root is nearly always a bad idea. Why is this? If I have access to the root password, and can simply sudo commands as root, what is the functional difference? The only difference I can see is that I have to continually type in my root password for pretty much everything I do. Elevating a user to root status seems to require a call to the almighty.

    I'm usually the only one with access to this system, and I generally like to add in user accounts for any other people that will use the system, and leave root for myself. What is the benefit of requiring 'sudo' all the time?

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,099
    Quote Originally Posted by Kincaid View Post
    Why is 'sudo' better than logging in as root?
    It's not necessarily better for everyone, but you can read this short article to help you decide if it's better for you:

    http://www.linuxforums.org/forum/ubu...in-ubuntu.html

    I personally never login as root, but I don't use sudo either. Instead, I use the su command to gain root permissions when needed. Run man su in a terminal to get more info on using su.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

  3. #3
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,102
    - With sudo, you do not need the root password. Just your user password.
    - Root has no restrictions. You can easily destroy your system with just one command
    - using sudo for elevated access creates awareness ("Now I need to be careful")
    - sudo can be restricted to certain commands, users and groups. Whereas root = root = full access
    - from remote (ssh): if you first have to login as a user via key and then elevate to root, you need to present *two* credentials before you have full access. Which improves security. Remote root logins should be disabled for this reason.

    There are surely more reasons, this was just a first braindump
    You must always face the curtain with a bow.

  4. #4
    Just Joined!
    Join Date
    Nov 2010
    Posts
    61
    sudo is mainly for newbies so they dont mess around with system files by accident.

    I have sudo turned off and "su" to root as normal when needed.

  5. #5
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,102
    Itīs a tool, and I kindly disagree: Itīs not only for newbies.

    Suppose you are a sysadmin and work with DBAs.
    You trust them enough to deal with their databases system.
    (Actually, according to their role, they should know more than a sysadmin )

    But you dont want them to mess with the rest of the system.
    In that case sudo could be used to let them e.g. restart their oracle/postgres/etc
    You must always face the curtain with a bow.

  6. #6
    Just Joined!
    Join Date
    Nov 2010
    Posts
    61
    Quote Originally Posted by Irithori View Post
    Itīs a tool, and I kindly disagree: Itīs not only for newbies.

    Suppose you are a sysadmin and work with DBAs.
    You trust them enough to deal with their databases system.
    (Actually, according to their role, they should know more than a sysadmin )

    But you dont want them to mess with the rest of the system.
    In that case sudo could be used to let them e.g. restart their oracle/postgres/etc
    Yeah i suppose you are right. Ive never been in that position where had to let others use admin privileges.

  7. #7
    Linux User sgosnell's Avatar
    Join Date
    Oct 2010
    Location
    Baja Oklahoma
    Posts
    358
    If you're logged in as root, then no further password is required to do anything. Any malware which comes in can do anything it wants. Granted, it's not nearly as common as on Windows, but it's possible, and anyone who can get in from the outside has acces while you're root. If you forget to log out, then the system is unprotected while you're gone. With sudo, the root privileges go away in 5 minutes, but if you log in as root, they don't go away until you log out.

  8. #8
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,230
    Some more materials you might be interested to read.
    nujinini
    Linux User #489667

  9. #9
    Just Joined!
    Join Date
    Mar 2010
    Posts
    79
    If you're logged in as root, then no further password is required to do anything. Any malware which comes in can do anything it wants.
    One can avoid that by using `su -c <command>`
    What is malware and where should it come from?


    Itīs a tool, and I kindly disagree: Itīs not only for newbies.

    Suppose you are a sysadmin and work with DBAs.
    You trust them enough to deal with their databases system.
    (Actually, according to their role, they should know more than a sysadmin )

    But you dont want them to mess with the rest of the system.
    In that case sudo could be used to let them e.g. restart their oracle/postgres/etc
    True, but that is not the way it is set-up in Ubuntu ( -> ALL).

    Login to GUI as root is a bad idea. As root you don't need lots of gui-apps (if at at all).
    Do what needs to be done as root and `exit` the terminal-emulator or close the app which you used.

    I for one would go for the default way of the OS (which, for Ubuntu, is the usage of sudo). Makes it more easy to communicate with others.
    I for one don't worry much about security. Are you sure it is that important to you?
    Just saying.

Posting Permissions

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