Samba Security

Lock up your smb.conf file, and throw away the key. Giving a person write access to smb.conf is as good as giving him the root password. Here's why.

Imagine a disgruntled employee writing a script that backs up /etc/passwd and then creates an /etc/passwd file with no root password. He logs in as root, without a password, and now has control of your system. He restores the original /etc/passwd and changes the password again.

But of course the script mentioned in the preceding paragraph won't work unless he's running as root. So he writes the script, manages to get write access to smb.conf, and adds a new share with a root preexec= option pointing to his mischievous script. He then accesses his new share through Samba, and immediately ...

Get Red Hat® Linux® 7 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.