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 ...
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 ...
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 ...
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'...
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 ...
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 ...
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 ...
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. ...
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::...
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: ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sudo × 81linux × 33
privilege-escalation × 20
permissions × 12
root × 12
passwords × 6
ssh × 6
ubuntu × 6
bash × 6
unix × 4
vulnerability × 3
macos × 3
install × 3
authentication × 2
web-application × 2
password-management × 2
exploit × 2
gnupg × 2
account-security × 2
hardening × 2
terminal × 2
capabilities × 2
sudoers × 2
network × 1
php × 1