Hot answers tagged

181 votes
Accepted

Is `sudo` almost useless?

Sudo has no real security purpose against a malicious third-party. So yes, it is basically useless for that purpose. In the past I believed it was actually a security control to prevent escalation of ...
reed's user avatar
  • 15.7k
126 votes

Is `sudo` almost useless?

I am the co-author of sudo. It was written in the early 80's specifically to address a need to protect the integrity of a shared resource (A VAX-11/750 running BSD UNIX) from its users (the faculty ...
Bob Coggeshall's user avatar
100 votes
Accepted

Why is root security enforced but $HOME typically unprotected?

I'm going to disagree with the answers that say the age of the Unix security model or the environment in which it was developed are at fault. I don't think that's the case because there are ...
Blrfl's user avatar
  • 1,618
85 votes
Accepted

Is it safe to allow www-data to execute privileged commands?

This... is atrocious. The whole point of running Web things as a non-root user is damage containment: in case the Web server process gets hijacked through some vulnerability, at least the attacker won'...
Tom Leek's user avatar
  • 172k
67 votes
Accepted

What are the potential vulnerabilities of allowing non-root users to run apt-get?

apt-get update -o APT::Update::Pre-Invoke::=/bin/sh From GTFOBins This gives you a root shell on the system. No creating packages and adding fake repos; this will give the user who runs this command ...
Cyclic3's user avatar
  • 845
59 votes

Why is it considered safe to install something as a non-root user in Linux environments?

We always hear... Do we? I don't. Installing some untrusted program as a normal user is a bad idea with Linux the same it is with Windows or Mac: this program has access to all your data and can ...
Steffen Ullrich's user avatar
55 votes

Why is root security enforced but $HOME typically unprotected?

Because the UNIX-based security model is 50 years old. UNIX underlies most widespread OSs, and even the big exception Windows has been influenced by it more than is apparent. It stems from a time ...
Kilian Foth's user avatar
50 votes

Is `sudo` almost useless?

No, sudo is not useless. As a user (target) Usually, when you're on Linux, you're acting as a non-root user. A lot of things, like installing packages with apt, need root/sudo permission to be used. ...
ChocolateOverflow's user avatar
46 votes

What are the potential vulnerabilities of allowing non-root users to run apt-get?

You say you're using a "custom curated apt repository" but there's no way to enforce that. Any user that can invoke apt can specify their own source list, for example apt install root-backdoor -o Dir::...
CBHacking's user avatar
  • 46.4k
36 votes
Accepted

Why is it considered safe to install something as a non-root user in Linux environments?

In short: yes, being on a low-privilege account helps protect you against malware, but does not make you immune. Like any security measure, no single thing is going to keep you 100% safe. TL;DR: ...
Mike Ounsworth's user avatar
31 votes

Why is root security enforced but $HOME typically unprotected?

This is a highly astute observation. Yes, malware running as your user can damage/destroy/modify data in your home directory. Yes, user separation on single user systems is less useful than on ...
David's user avatar
  • 16.1k
27 votes
Accepted

Is disabling sudo password prompt a security risk?

Yes, it's a risk. Anyone who touches your keyboard can get root access by running sudo and not worrying about your password. Anyone who has an exploit that gets them userland access can instantly get ...
Adam Shostack's user avatar
26 votes
Accepted

Best practices for hardening sudo?

Your question is rather broad, touching on several different subjects. It may be better to take some of the details and put them in a separate question. Is it enough to forbid su and allow sudo in ...
700 Software's user avatar
25 votes

Why is root security enforced but $HOME typically unprotected?

The original design of Unix/Linux security was to protect a user from other users, and system files from users. Remember that 30-40 years ago, most Unix systems were multi-user setups with many ...
Steve Sether's user avatar
  • 21.6k
22 votes
Accepted

Why should one use sudo?

There are valid convenience uses for sudo, but because they are already adequately explained in other posts, I won't elaborate on them much here. I will however point you to sudoers(5), which is the ...
forest's user avatar
  • 66.5k
20 votes

Is it secure to mount Veracrypt without sudo password in this way

This is extremely insecure. I'm glad you asked elsewhere before running this setup yourself! I hope those 3000+ people on AskUbuntu were similarly cautious. So, why is this insecure? What can an ...
forest's user avatar
  • 66.5k
20 votes

Is `sudo` almost useless?

Sudo is far from being useless. An admin can assign privileges flexibly and granularly and have accountability options (decent logging). It's a significantly better solution to using groups. ...
Pedro's user avatar
  • 3,931
20 votes
Accepted

The rationale behind allowing `sudo -u root` but disallowing `sudo -u <any other user>`

My guess would be the depth of a corporate policy jungle surrounding non-repudiation in combination with a lack in the communication of technical details. As example: If there is a rule that any ...
fleitner's user avatar
  • 598
18 votes
Accepted

Is it safer to ssh as a privileged user than to ssh and sudo?

It is a matter of risk assessment. On the one hand you have a speculative article where you base ephemeral information on some vague timings. On the other hand you have the capacity to connect to ...
WoJ's user avatar
  • 9,028
18 votes

Why should one use sudo?

Aside what's mentioned by the other users, sudo also keeps the original identity of the user that's executing the command. Meaning that you can track what userid performed the command. If you are ...
Lucas Kauffman's user avatar
18 votes

Is `curl {something} | sudo bash -` a reasonably safe installation method?

There are three major security features you'd want to look at when comparing curl ... | bash installation to a Unix distribution packaging system like apt or yum. The first is ensuring that you are ...
cjs's user avatar
  • 399
18 votes

Is `sudo` almost useless?

sudo is as secure, or insecure, as its popular alternatives like su. The most popular alternative to sudo is to allow some or all users to elevate their privileges with su. Most commonly, all users ...
Eliah Kagan's user avatar
  • 1,315
17 votes

Is `sudo` almost useless?

The point of sudo is not to make it hard to elevate privileges. It is, in fact, the exact opposite: the point is to make it easy to elevate privileges. By making it easy to elevate privileges when ...
Jörg W Mittag's user avatar
14 votes

Is it safe to allow www-data to execute privileged commands?

When considering how secure something is, you should assume the attacker is able to log in as your www-data user, and have a shell. This does not mean your attacker really can get a shell, but there ...
Guntram Blohm's user avatar
12 votes

Is it safer to ssh as a privileged user than to ssh and sudo?

"connect as an unprivileged user and then successively sudo into the root account" is usually the recommended way of using UNIX systems. Many distributions are configured by default to not allow ...
Philipp's user avatar
  • 49.4k
10 votes

Why is root security enforced but $HOME typically unprotected?

Is there no way to prevent malicious code happening in $HOME? To answer this question, what some installations do is make use of the existing security framework by making a user specifically to run ...
JoL's user avatar
  • 252
10 votes

What are the potential vulnerabilities of allowing non-root users to run apt-get?

Would preventing users from specifying their own sourcelists (e.g. by making a wrapper that specifically calls apt-get install -- <packages> with root privileges) be sufficient to prevent users ...
Arminius's user avatar
  • 44.7k
9 votes

Why is it considered safe to install something as a non-root user in Linux environments?

This is a horrible case of Security Theater Security Theater is the practice or belief of something that looks like it improves security, but in reality does little/harm to it. This false belief has ...
Robert Mennell's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible