Paranoid Penguin - Linux Filesystem Security, Part II

We covered the fundamentals of permissions last month. Now it's time to learn some useful bits to make cooperation among users convenient and secure.

Save and exit the file.

Now, to do his thing, crash enters the command:

sudo rm /home/biff/extreme_casseroles/pineapple_mushroom_surprise.txt

whereupon he is prompted to enter his password. After he enters this correctly, the command:

/bin/rm /home/biff/extreme_casseroles/pineapple_mushroom_surprise.txt

is executed as root, and the offending file is gone.

Alternately, the line in /etc/sudoers could look like this:

crash localhost=/bin/rm /home/biff/extreme_casseroles/*

That way, crash can delete anything in extreme_casseroles/, regardless of the sticky bit setting.

As handy as it is, sudo is a powerful tool, so use it wisely; root privileges never should be trifled with. It really is better to use user and group permissions judiciously than to hand out root privileges, even with sudo. Better still, use an RBAC-based system such as SELinux if the stakes are high enough.

That's it for now. I hope you've found this tutorial useful. Until next time, be safe!

Mick Bauer, CISSP, is Linux Journal's security editor and an IS security consultant in Minneapolis, Minnesota. He's the author of Building Secure Servers With Linux (O'Reilly & Associates, 2002).



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Trupti's picture

Helpful post. Every bit is covered here.Thank you.

One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix