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