« Previous 1 2 3 4
Useful NFS options for tuning and management
Tune-Up
Subtree Checking
Assume the NFS server has exported a directory from the root filesystem (e.g., /usr/local
). Also assume that it is part of the root disk for the system (i.e., it's not on a separate partition or drive). On a compromised NFS client, the cracker could guess the file handle for a file that is in the filesystem but not in /usr/local/
(the NFS-exported directory). Now your NFS server has been compromised.
Adding the option subtree_check
to the exports on the NFS server checks that the file being accessed is contained within the exported directory. In the case here, it would force the NFS server to check that the requested file was located within /usr/local/
. Alternatively, you can specify the option no_subtree_check
on the NFS server, and it will not check that the requested file is in the exported directory. Many people have the opinion that subtree_check
can have a big effect on performance, but the final determination is up to you. Is performance more important than security for the configuration and your situation?
One way to overcome the need for subtree_check
is to put the exported directory on a separate partition or separate drive to prevent a rogue user from guessing a file handle to anything outside of the filesystem. You should partition your drive space and give a specific mount point to the directory that is to be exported. For example, if you want to export /usr/local/
, it should have its own storage partition (or drive) and be mounted as /usr/local
on the NFS server. By doing this, crackers can't guess file handles outside of the specific export.
Root Squashing
By default, the root user is "squashed" to the user nobody so that NFS access is compartmentalized. This point is important, because if a rogue user boots a system from some sort of medium (e.g., a USB stick), the user can be root on that system and could then change the IP address to gain access to the system, mount a filesystem, and copy data from the server. However, if root is squashed to user nobody , then root will have the same privileges given to all users, thus preventing a compromised system from allowing root to pull data from your system.
On the other hand, if you want root to have access to an NFS-mounted filesystem, you can add the option no_root_squash
to the file /etc/exports
to allow root access. Just be aware that if someone reboots your system to gain root access, it's possible for them to copy (steal) data.
Summary
In this article, I presented various options you could use to improve performance on an NFS filesystem, although depending on your circumstances, they might not help or might even result in reduced performance. Some of these tuning parameters are NFS options, whereas others involve changes to the system that improve performance or are options for managing NFS filesystems. The best way to judge which options are useful is to run tests, particularly with the applications you plan on running.
Infos
- FS-Cache: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/fscachenfs.html
- mount man page: http://linux.die.net/man/8/mount
- "Deploying 10GigE Network For High Performance Clusters" by Li Ou, Dell Technical White Paper, undated: http://www.dell.com/downloads/global/solutions/dell_nfs_server.pdf
- Netperf: http://www.netperf.org/netperf/
« Previous 1 2 3 4
Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.