Language Selection

English French German Italian Portuguese Spanish

Sudo: Why Ubuntu does it right

Filed under
Ubuntu

One of the most famous Linux debates on the internet is over Ubuntu's security model of using sudo to administrate a machine and disabling the traditional root login via su. For many experienced Linux and unix sysadmins, such behavior is strange and foreign, and many people change sudo on Ubuntu to behave like "normal." I, on the other hand, have gradually come to believe that not only is the Ubuntu way good, it is actually better! In this post I'll attemp to explain why. You can read the long-winded official explanation of why Ubuntu uses sudo, but I'll attempt to summarize. Basically, there are two main benefits to the Ubuntu sudo model that I see:

1. Disabling the root account entirely provides an extra layer of security from remote hackers.

2. Using sudo adds an extra layer of abstraction in the security model.

rest here




re: Sudo

Yes, if you're too stupid to understand how permissions work, then I guess typing SUDO EVERYTHING is the only way to protect you from yourself.

Sudo in Ubuntu is no better (or worse) then UAC in Vista.

And disabling root, but leaving sudo enabled DOES NOTHING to increase security.

Personally, my computers work for me, and not the other way around (of course I have a IQ considerably higher then 80, so I'm not the typical user that Unoobtu targets).

re: re: Sudo

Vonskippy wrote:
And disabling root, but leaving sudo enabled DOES NOTHING to increase security.

Yes, the use of sudo has to be the biggest and most unnecessary time-waster in all of Linux.

I've been running Linux for

I've been running Linux for 10 years and never been remote hacked. That is because I dont run as root and use a strong root password. If I got into a ubuntu box couldnt I just sudo anything I wanted?

no, you couldn't,

because the default behavior of sudo in ubuntu is to ask the use to AUTHENTICATE. They need to know the user's password to sudo, but first they need to know the username to login at all. A remote hacker (especially a bot) would have no idea what users are on a system in the first place anyways.

However, you're right, not running as root is the same idea as using sudo. You just open up a shell with su and do your commands, then close the root shell. That is how a good sysadmin works, I'm simply arguing that using sudo is the same idea as that, taken one step further.

Sudo is less secure...

By using the USER password, Sudo is less secure. A better way would be to require a second Sudo password for each user in the sudoers list.

Also, I agree with vonskippy. It simply does nothing to increase security and is just a nuscance like UAC. I also don't like distros that attempt to protect me from myself. This is a Microsoft way of thinking and exactly why security is so lax an home computers. People need to be educated more about them so that they learn how to do it right and not rely on someone else to secure it.

Not the same as UAC

Hi, this is the author of the blog post. I can't believe my blog actually made it to tuxmachines. Big Grin omg I feel special.

Anywho, to address some of the comments, I wasn't really intending to compare sudo to UAC, rather I was comparing it to the tradition su method seen in other linux distros. However.... I cannot stress enough that sudo is NOT the same as vistas UAC. sudo forces you to authenticate, UAC merely asks if you're really sure you want to do that. This is more secure, period. In Linux, the administrator is clearly separated from the user. I am an educated linux user, and I do understand how permissions work, yet I still prefer to use sudo. Why? because I am protecting myself. When I use sudo, I'm saying "this, and only this process may run as root. Here's my password to prove it's okay to do this." When I click on yet another UAC prompt, I'm saying "yes I want to run the stupid program that I JUST TOLD YOU TO RUN. OK."

Also, the protection against remote hackers is less of an issue for a regular desktop and more of an issue for a web server connected directly to the internet. For such a server, this is a very, very, important issue, since you can get bombarded by bots all the time just trying to connect in various ways, simply because the server is there. I've seen it happen.

Family Computer

If I have a family computer where 3-4 people can use it. Do they all have the ability to install/remove software on it using sudo?

re:Family Computer

No, they don't all have access unless you add them to the "admin" group in Ubuntu. When you install Ubuntu, the first account (which is created during the install) is part of this admin group, and has privileges to use sudo. Who can and cannot use sudo to do various tasks can be fine-tuned in the /etc/sudoers file, but by default, only the first user can sudo.

Admin group - enabled by default on Ubunt

scarter4 wrote:
No, they don't all have access unless you add them to the "admin" group in Ubuntu. When you install Ubuntu, the first account (which is created during the install) is part of this admin group, and has privileges to use sudo. Who can and cannot use sudo to do various tasks can be fine-tuned in the /etc/sudoers file, but by default, only the first user can sudo.

OK, there are flaws there. You are assuming that every user is set up as a different user but the gist of the original question, seemed to me, to imply that everyone was using the same login. What then?
I don't use ubuntu. I have one user and root. Anyone in my family can access usr but only I can access root.
What would be the situation on a similar setup in Ubuntu?
I think Ubuntu is flawed in their admin at setup route as most ubuntu users have migrated from Windows and don't do separate user setups. Add in auto login and you have a system open to borks by people fiddling. For this reason I'd never have Ubuntu in a school for example.
User and root is the way to go and if you do want to Sudo then at least prompt for a separate root password.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

More in Tux Machines

Security: New Release of HardenedBSD, Windows Leaks Details of Windows Back Doors

  • Stable release: HardenedBSD-stable 11-STABLE v1100054
  • Kaspersky blames NSA hack on infected Microsoft software
    Embattled computer security firm Kaspersky Lab said Thursday that malware-infected Microsoft Office software and not its own was to blame for the hacking theft of top-secret US intelligence materials. Adding tantalizing new details to the cyber-espionage mystery that has rocked the US intelligence community, Kaspersky also said there was a China link to the hack.
  • Investigation Report for the September 2014 Equation malware detection incident in the US
    In early October, a story was published by the Wall Street Journal alleging Kaspersky Lab software was used to siphon classified data from an NSA employee’s home computer system. Given that Kaspersky Lab has been at the forefront of fighting cyberespionage and cybercriminal activities on the Internet for over 20 years now, these allegations were treated very seriously. To assist any independent investigators and all the people who have been asking us questions whether those allegations were true, we decided to conduct an internal investigation to attempt to answer a few questions we had related to the article and some others that followed it:
  • Kaspersky: Clumsy NSA leak snoop's PC was packed with malware
    Kaspersky Lab, the US government's least favorite computer security outfit, has published its full technical report into claims Russian intelligence used its antivirus tools to steal NSA secrets. Last month, anonymous sources alleged that in 2015, an NSA engineer took home a big bunch of the agency's cyber-weapons to work on them on his home Windows PC, which was running the Russian biz's antimalware software – kind of a compliment when you think about it. The classified exploit code and associated documents on the personal system were then slurped by Kremlin spies via his copy of Kaspersky antivirus, it was claimed.

OSS Leftovers

  • Open Source Networking Days: Think Globally, Collaborate Locally
    Something that we’ve learned at The Linux Foundation over the years is that there is just no substitute for periodic, in-person, face-to-face collaboration around the open source technologies that are rapidly changing our world. It’s no different for the open networking projects I work with as end users and their ecosystem partners grapple with the challenges and opportunities of unifying various open source components and finding solutions to accelerate network transformation. This fall, we decided to take The Linux Foundation networking projects (OpenDaylight, ONAP, OPNFV, and others) on the road to Europe and Japan by working with local site hosts and network operators to host Open Source Networking Days in Paris, Milan, Stockholm, London, Tel Aviv, and Yokohama.
  • The Open-Source Driving Simulator That Trains Autonomous Vehicles
    Self-driving cars are set to revolutionize transport systems the world over. If the hype is to be believed, entirely autonomous vehicles are about to hit the open road. The truth is more complex. The most advanced self-driving technologies work only in an extremely limited set of environments and weather conditions. And while most new cars will have some form of driver assistance in the coming years, autonomous cars that drive in all conditions without human oversight are still many years away. One of the main problems is that it is hard to train vehicles to cope in all situations. And the most challenging situations are often the rarest. There is a huge variety of tricky circumstances that drivers rarely come across: a child running into the road, a vehicle driving on the wrong side of the street, an accident immediately ahead, and so on.
  • Fun with Le Potato
    At Linux Plumbers, I ended up with a Le Potato SBC. I hadn't really had time to actually boot it up until now. They support a couple of distributions which seem to work fine if you flash them on. I mostly like SBCs for having actual hardware to test on so my interest tends to be how easily can I get my own kernel running. Most of the support is not upstream right now but it's headed there. The good folks at BayLibre have been working on getting the kernel support upstream and have a tree available for use until then.
  • PyConf Hyderabad 2017
    In the beginning of October, I attended a new PyCon in India, PyConf Hyderabad (no worries, they are working on the name for the next year). I was super excited about this conference, the main reason is being able to meet more Python developers from India. We are a large country, and we certainly need more local conferences :)
  • First Basilisk version released!
    This is the first public version of the Basilisk web browser, building on the new platform in development: UXP (code-named Möbius).
  • Pale Moon Project Rolls Out The Basilisk Browser Project
    The developers behind the Pale Moon web-browser that's been a long standing fork of Firefox have rolled out their first public beta release of their new "Basilisk" browser technology. Basilisk is their new development platform based on their (Gecko-forked) Goanna layout engine and the Unified UXL Platform (UXP) that is a fork of the Mozilla code-base pre-Servo/Rust... Basically for those not liking the direction of Firefox with v57 rolling out the Quantum changes, etc.
  • Best word processor for Mac [iophk: "whole article fails to mention OpenDocument Format"]
  • WordPress 4.9: This one's for you, developers!
    WordPress 4.9 has debuted, and this time the world's most popular content management system has given developers plenty to like. Some of the changes are arguably overdue: syntax highlighting and error checking for CSS editing and cutting custom HTML are neither scarce nor innovative. They'll be welcomed arrival will likely be welcomed anyway, as will newly-granular roles and permissions for developers. The new release has also added version 4.2.6 of MediaElement.js, an upgrade that WordPress.org's release notes stated has removed dependency on jQuery, improves accessibility, modernizes the UI, and fixes many bugs.”
  • New projects on Hosted Weblate
  • Cilk Plus Is Being Dropped From GCC
    Intel deprecated Cilk Plus multi-threading support with GCC 7 and now for GCC 8 they are looking to abandon this support entirely. Cilk Plus only had full support introduced in GCC 5 while now for the GCC 8 release early next year it's looking like it will be dropped entirely.
  • Software Freedom Law Center vs. Software Freedom Conservancy

    On November 3rd, the Software Freedom Conservancy (SFC) wrote a blog post to let people know that the Software Freedom Law Center (SFLC) had begun legal action against them (the SFC) over the trademark for their name.

  • What Is Teletype For Atom? How To Code With Fellow Developers In Real Time?
    In a short period of three years, GitHub’s open source code editor has become one of the most popular options around. In our list of top text editors for Linux, Atom was featured at #2. From time to time, GitHub keeps adding new features to this tool to make it even better. Just recently, with the help of Facebook, GitHub turned Atom into a full-fledged IDE. As GitHub is known to host some of the world’s biggest open source collaborative projects, it makes perfect sense to add the collaborative coding ability to Atom. To make this possible, “Teletype for Atom” has just been announced.
  • Microsoft Is Trying To Make Windows Subsystem For Linux Faster (WSL)
  • Microsoft and GitHub team up to take Git virtual file system to macOS, Linux

Ubuntu: New Users, Unity Remix, 18.04 LTS News

  • How to Get Started With the Ubuntu Linux Distro
    The Linux operating system has evolved from a niche audience to widespread popularity since its creation in the mid 1990s, and with good reason. Once upon a time, that installation process was a challenge, even for those who had plenty of experience with such tasks. The modern day Linux, however, has come a very long way. To that end, the installation of most Linux distributions is about as easy as installing an application. If you can install Microsoft Office or Adobe Photoshop, you can install Linux. Here, we’ll walk you through the process of installing Ubuntu Linux 17.04, which is widely considered one of the most user-friendly distributions. (A distribution is a variation of Linux, and there are hundreds and hundreds to choose from.)
  • An ‘Ubuntu Unity Remix’ Might Be on the Way…
    A new Ubuntu flavor that uses the Unity 7 desktop by default is under discussion. The plans have already won backing from a former Unity developer.
  • Ubuntu News: Get Firefox Quantum Update Now; Ubuntu 18.04 New Icon Theme Confirmed
    Earlier this week, Mozilla earned big praises in the tech world for launching its next-generation Firefox Quantum 57.0 web browser. The browser claims to be faster and better than market leader Google Chrome. Now, Firefox Quantum is available for all supported Ubuntu versions from the official repositories. The Firefox Quantum Update is also now available.
  • New Icon Theme Confirmed for Ubuntu 18.04 LTS
    ‘Suru’ is (apparently) going to be the default icon theme in Ubuntu 18.04 LTS. That’s Suru, the rebooted community icon theme and not Suru, the Canonical-created icon theme that shipped on the Ubuntu Phone (and was created by Matthieu James, who recently left Canonical).

OnePlus 5T Launched

  • OnePlus 5T Keeps the Headphone Jack, Introduces Face Unlock and Parallel Apps
    Five months after it launched its OnePlus 5 flagship Android smartphone, OnePlus unveiled today its successor, the OnePlus 5T, running the latest Android 8.0 (Oreo) mobile OS. OnePlus held a live event today in New York City to tell us all about the new features it implemented in the OnePlus 5T, and they don't disappoint as the smartphone features a gorgeous and bright 6.0-inches Optic AMOLED capacitive touchscreen with multitouch, a 1080x2160 pixels resolution, 18:9 ratio, and approximately 402 PPI density. The design has been changed a bit as well for OnePlus 5T, which is made of anodized aluminum.
  • OnePlus 5T Launched: Comes With Bigger Screen, Better Dual Camera, And Face Unlock
    Whenever costly phones like iPhone X or Google Pixel 2 are bashed (here and here) and their alternatives are discussed, OnePlus is always mentioned. In the past few years, the company has amassed a fan base that has found the concept of “Never Settle” impressive.
  •