Paranoid Penguin - Linux Filesystem Security, Part II

 in
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).

______________________

Comments

Comment viewing options

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

Comment

Trupti's picture

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

Webcast
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers

Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.

Learn More

Sponsored by AMD

White Paper
Red Hat White Paper: Using an Open Source Framework to Catch the Bad Guy

Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6

Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.

Learn more about catching the bad guy in this free white paper.

Learn More

Sponsored by DLT Solutions