I noticed that my /etc/sudoers is owned by root:root and it's 0440:

$ ls -l /etc/sudoers
-r--r----- 1 root root 755 feb  3  2020 /etc/sudoers

Note that it's not world-readable.

I'm struggling to think what security risks there could be to knowing who is allowed to use sudo.

  • I guess in my mind it would be the equivalent of knowing who to target. It would open up privileged accounts to unnecessary attacks (potentially). Aside from that over simplified opinion, you have a good question and I'd be curious to see what the experts have to say.
    – bgregs
    Jan 14, 2019 at 14:29

3 Answers 3

  • needless leak of information; if any account or process is compromised the attacker may then read the sudoers configuration and use that information to figure out next targets (accounts, allowed programs, ...)
  • needlessly world-readable files may create conditions for denial of service attacks e.g. Sendmail files and locking mechanisms https://securitytracker.com/id/1004368 (world-readable files can also be opened by many processes; this may slow down I/O performance on the file which is probably not relevant for sudo though may be bad for a database or logging daemon)
  • unknown vulnerabilities that let the attacker do something really clever via some almost forgotten ioctl or buggy audio interface that the needlessly world-readable file gives them enough of a toe-hold to climb

Short questionable answer:

Long answer:

Your point of view is completely acceptable. GNU/Linux was designed without security through obscurity in mind. Some examples:

  • /etc/passwd - everyone in your system is allowed as default to discover whatever user and group exist. This is fine because the only secret is their password, not their existence.
  • /etc/ssh/sshd_config - everyone in your system is allowed to analyze how your SSH server is configured. This is fine because the only secret is the password and the private keys of your SSH users, not how your SSH server works, and not their public keys.

Maybe sudo developers would like to hide a parliament to make its state safer. Who knows.


Being able to target a user with sudo privileges makes compromise easier. Same reason /etc/shadow is read-only, and only by root. Security through obscurity thwarts more attacks than it's given credit for.

  • 2
    I wholly disagree in the likeliness between sudoers and /etc/shadow. Shadow contains passwords (albeit hashed passwords). The contents must be kept secret. Sudoers is frequently never modified from the distribution and therefore rarely a secret. Jan 14, 2019 at 16:24
  • 1
    "Security through obscurity thwarts more attacks than its' given credit for" except that nobody will tell you how many, because, well, it's a secret.
    – user313992
    Feb 12, 2021 at 2:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .