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.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState