Skip to main content
183 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.9k
127 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
99 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,608
68 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
  • 855
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
  • 50.3k
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
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
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
  • 67.1k
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
  • 628
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
  • 585
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
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

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

"Reasonably Safe" depends on your goalposts, but curl | bash is well behind state-of-the-art. Let's take a look at the kind of verification one might want: Ensuring that someone malicious at your ...
Charles Duffy's user avatar
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
  • 45k
9 votes
Accepted

Is it safe to use a unix pipe to redirect sensitive output data as input to another program?

The | is anonymous. The pipe will usually not be accessible to anyone who isn't root or the owner of one of the processes. As soon as you read the standard input and close it, the cat process will ...
Ed Grimm's user avatar
  • 258
9 votes

Is `sudo` almost useless?

Like everything in information security, sudo is a trade-off. Let's explore the alternatives: changing the system so the commands you use sudo for don't require root-level privileges logging in as ...
Tom's user avatar
  • 10.7k
9 votes
Accepted

Security implications of increasing sudo timeout in terminal

I don't think increasing the timeout to 1h would change much the security. An attacker can backdoor sudo with one minute of access to your terminal, so 5 minutes or 60 are the same in my opinion. With ...
ThoriumBR's user avatar
  • 55.1k
8 votes

Why is root security enforced but $HOME typically unprotected?

To answer the second part of your question: There are sandbox mechanisms, but they are not enabled by default on most linux distributions. An very old and complicated one is selinux. A more recent and ...
allo's user avatar
  • 3,451
8 votes
Accepted

Do sudo and .profile/.bashrc enable trivial privilege escalation?

Anything you can do on a compromised account, an attacker can do as well. Fundamentally, this is because Linux providers isolation between users, not between individual processes running as the same ...
forest's user avatar
  • 67.1k
7 votes
Accepted

Is an asterisk in sudo command specifications safe?

Different applications have a different understanding of what the asterisk means. Shells tend to treat it for parameter expansion, which can be quite complex in implementation and often results in ...
forest's user avatar
  • 67.1k
7 votes

Is `sudo` almost useless?

This depends on how you configure sudo: On a machine used by different persons, you can configure sudo in a way that certain users can access certain commands using sudo: You may configure sudo in a ...
Martin Rosenau's user avatar
7 votes

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

What are the potential vulnerabilities of allowing non-root users to run apt-get? Full system compromise; Persistent privilege escalation from the user allowed to run apt-get to root. My ...
Pedro's user avatar
  • 3,931
6 votes

What can an attacker do in this scenario? (unwritable bashrc, profile, etc.)

Path is defined in bash profile so that ~/bin comes last, so running "firefox" should run the default firefox and not a custom "firefox" installed by the user in their home directory. Variables can ...
vidarlo's user avatar
  • 16.9k
6 votes

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

Submitting an answer to my own question. Not sure if this is the best answer, but I'm hoping other answers will address these points. curl {something} | sudo bash - on Linux is equally safe as ...
Krubo's user avatar
  • 859

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