9 ms·
Beware of sudo on OS X
- brobinson 11y agoIs there some kind of advantage to this option not being set by default?
- therealmarv 11y agoI can imagine that some scripts which go deep into the system like e.g. driver installation in OS X might not work anymore after patching OS X yourself.
- daxelrod 11y agoAre you suggeting that changing documented settings for a system component is "patching OS X yourself"? Anecdotally, I ran OS X for years with timestamp_timeout set to 0 so that sudo always prompted for a password. This broke absolutely nothing.
- hollerith 11y agoAccidentally downvoted you (instead of upvoting).
- lisper 11y agoSure, it makes things more convenient. Convenience and security are always a trade-off.
- adamnemecek 11y agoThe parent comment was probably asking about some specific advantages.
- eikenberry 11y agoConvenience is a specific advantage. It also is a great boon when you are used to working in multiple terminals or are running a lot of remote sudo commands over ssh (say testing an ansible setup).
- chmaynard 11y agoIf I set this option, I wonder if OS X third-party app installers will be affected? They often ask for the admin password, presumably to install software in directories owned by the system.
- manicdee 11y agoThe "advantage" is the convenience mentioned in the (short, succinct) article: I can enter my password for sudo in one terminal window, and escape having to type it again in the other terminal window(s).
- spitfire 11y agoFunny, I always thought this was supposed to be a feature. It remembered your authentication for a few minutes after using sudo. I assumed it was part of the OSX auth system and would forget if you locked the screen.
- gosukiwi 11y agoYeah I was thinking the same thing, probably that is why they ship those defaults, better UX.
- marcoamorales 11y agoDon't call a security flaw a UX feature please.
- quesera 11y agoPasswords are both security flaws and UX features -- they're inherently flawed, cannot be fixed, and are the only authentication system most people can use successfully. Security is always in tension with usability.
- chadzawistowski 11y agoI think the flaw marcoamorales intended to point out is how sudo doesn't always re-prompt for a password.
- vortico 11y agoEnabling `tty_tokens` still remembers your authentication for a few minutes, but it restricts use to the terminal it was run on.
- lambda 11y agoIt is a feature that it caches your authentication for a few minutes. It's not a feature that other processes running as your user, such as something that manages to do a sandbox escape in your browser, are also able to acquire credentials.
- daily_dose_420 11y agoOnly a moron would run anything that isn't GNU/Linux or BSD.
- jmhobbs 11y agoI bet you're fun at parties.
- daily_dose_420 11y agoI bet you're a pseudo intellectual hipster that likes watching cuckold porn on your retina mac book pro air usb C. Let me know if you need help de-soldering your hard drive LOL! Enjoy your starbucks bitch. #blacklivesmatter
- gruez 11y ago>What this means is that if you use sudo to give yourself root privileges, your sudo authentication is not bound to the TTY in which you ran sudo. It applies to any process you (or malware running as you) start after authentication. The way Apple ships sudo it is, essentially, a giant privilege escalation vulnerability. But even if you enable TTY tickets, a malicious process on your system can still elevate itself by patching the shell (in memory, using /proc/id/mem) to inject commands alongside the original sudo command. For example: User types: sudo apt-get update shell executes: sudo bash -c "apt-get update; evil.sh"
- vezzy-fnord 11y agoDoes OS X have a procfs?
- bbrazil 11y agoOS X doesn't have a procfs. I'd presume there's a syscall and/or debug feature that offers similar functionality.
- vortico 11y agoOr simply append `alias sudo="sudo evil.sh; sudo"` to .bash_profile. Although, OS X is a bit like Windows. A bad program running in userspace can essentially ruin your system as much as a program running as root. Privilege escalation is not a relatively big deal when you can `shred -u ~/` without root.
- JakaJancar 11y agoHonest question: Why does anyone still care about root escalation on workstations? When do we stop pretending our MacBooks are multi-user UNIX mainframes? App sandbox to full user privilege escalation may be scary. But if someone can run arbitrary code as my user, then by all means, have root as well.
- vezzy-fnord 11y agoWhen do we stop pretending our MacBooks are multi-user UNIX mainframes? This is actually a good point, even if I disagree with your minimization of privsep's importance.
- vortico 11y agoThis is my view as well---not sure why it was downvoted. If I have access to ~/.mozilla and ~/.chrome in userspace, I probably have access to your email password.
- MrTonyD 11y agoI was part of the original UNIX porting team at NeXT, and we were just trying to get the most popular non-proprietary operating system (UNIX) modernized (by using Avie's CMU Mach) as the modern core to a standard OS. We didn't even think about any server type applications. And Steve told us that he was tired of being beaten-up at Apple for being closed source - so he wanted UNIX. (As an aside, he refused to allow any object-oriented tools in the system - but in Engineering we realized that Steve wouldn't know an object-oriented system from a hole in the ground, so we ignored his direct orders to not put in anything object oriented. The rest is history.)
- feelix 11y agoWhy was he against object orientation?
- stcredzero 11y agoMy guess: Back at that time, it was harder to afford the extra resources for OO. It's not until the time I graduated college that machines and VMs of managed environments started to get faster than "embarrassingly slow" in mainstream hands. This is also a big part of the reason why there were languages like Eiffel and also why C++ got so entrenched. Also explains the existence of Objective-C.
- X-Istence 11y agoAnd this is a good reason to lock sudo down to a single application that is allowed to be run. In my case I only allow su for my user. Now even if an attacker were to try and use sudo they would also have to know that they can only use su, and most automated attacks will fail.
- eeZi 11y agoThey'd just have to "sudo -l". No logging of executed commands either, that way.
- code_sterling 11y agoBeware of sudo, always, everywhere. Seriously.
- nbevans 11y agoApple is going through the same awkward phase as Microsoft did with WinXP. Except unlike what Microsoft did, Apple has not started a decisive internal process to change things for the better.
- pluckytree 11y agoHow do you know this to be the case? Just curious.