I'm setting up two VMs on Google Cloud Platform (GCP) for file sharing. One VM (the server) has a mounted disk that needs to be writable, while the other VM (the client) requires read-only access. I thought about using SSHFS, but I've heard it's better for short-term tasks, can use up CPU and bandwidth, and is also no longer maintained, which raises security concerns. Instead, I'm considering using NFS. The server is public-facing with its own DNS, and the client is for internal staff use, secured with SSH keys only. However, I've read NFS can be unstable, and I want to know if it's a secure alternative to SSHFS for my needs. Are there specific configurations I should implement if I decide to go with NFS?
4 Answers
NFS can be problematic, especially with hanging connections. I often find myself rebooting clients and servers because they lose sync. If you don’t need instant updates and can handle occasional delays, consider using rsync to keep files synced efficiently. It’s solid for transferring only the changes, so you won’t overload your bandwidth. You might also look into WebDAV for a remote file system that can be mounted as read-only.
These VMs are on GCP, and you want to connect them over the internet? It might be better to utilize a VPC. Consider the latency between the VMs, as even 1ms can be problematic for NFS, especially if you're working with many small files.
Have you thought about using SMB instead of NFS? Just make sure to set it up through a VPN for security.
SSHFS is pretty easy to use, and its security hinges on SSH, which is well-maintained. But if you want a more robust alternative, NFS over a VPN is a better choice. Avoid using NFS directly over the internet—that's a security risk you don’t want to take.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures