I was idly reading http://nfs.sourceforge.net/nfs-howto/ar01s06.html trying to understand why localhost exports were bad when I got to the section "6.4. Tunneling NFS Through SSH". Everything in that section about it being a possible security vulnerability to export localhost because it allows others to ssh port forward in and access the share made sense.
Here's my question, how does one keep ssh tunnels from undermining the security of a system if users can ssh in to a machine that can connect to an NFS server? For instance imagine computers A(192.168.1.1
), B(192.168.1.2
) and C(192.168.1.3
). Let A be the server with the following export file:
/home 192.168.1.2(rw)
As you can see A is giving B permission to use the /home share. Now, let C ssh into B with:
$ ssh 192.168.1.2 -L 250:192.168.1.1:2049 -f sleep 60m
$ ssh 192.168.1.2 -L 251:192.168.1.1:32767 -f sleep 60m
It would seem that A's shares exported to B are vulnerable to anyone that can ssh into B. Is this the case? Is there a way to protect against this other than simply making sure anyone that can log into B is a very trusted user?