I'm looking to set up a remote file sharing system between two VMs on Google Cloud Platform (GCP). One VM, which I'll refer to as the server, needs read/write access to a mounted disk, while the other VM, the client, only needs read-only access. I originally thought about using SSHFS, but I found out it's more suited for short-term use, it's no longer maintained, and using it could lead to performance issues.
Now I'm considering NFS, but I want to know if it's a secure option for my needs, especially since the server has a public webpage and the client is meant for internal use only. Both VMs are accessible via SSH keys only, with no interactive authentication. I've learned that GCP only allows read-only access to non-boot disks when connecting to multiple VMs, so I'm curious about the requirements and security of setting up NFS with auto-mounting for my situation. Any insights or recommendations?
2 Answers
SSHFS does have its pros, particularly its ease of use and reliance on SSH for security. However, I recommend using NFS over a VPN for a more secure setup. Directly using NFS over the internet isn't secure, so a VPN adds an essential layer of protection. Just ensure the VPN is configured correctly for your needs!
Be cautious with NFS; it can be finicky, especially in unstable network conditions. It’s prone to hanging, which could be frustrating. If you can live with a slight delay in data sync, consider using rsync instead. It’s efficient—if you only change a small part of a large file, it only transfers what's necessary. Also, check out WebDAV, which allows for shared file access over HTTP. Just weigh your need for real-time access against these options!
Thanks for the tips! After talking with my team, we’re leaning towards rsync since they don’t need instant access. I’ll also look into how sshpass fits into this. Appreciate the help!