I have SSHFS on my server and would like to have it automatically mounted and store all of the documents, desktop, downloads, etc. on a couple computers. I am able to get it to all work except for mounting on startup. The server is Debian 12 and both clients are Tumbleweed. Nothing in fstab seems to work. When I add x-systemd.automount, well, at best programs that try to use it crash and at worst I have to go through recovery mode to get the system to boot properly. I am using ed25519 keys with no passwords for authentication. Does anyone know how I could get this to work?
Using systemd is way better than fstab even though it requires way more work. Systemd can automatically mount it when the server is available.
Also why are you using sshfs? Wouldn’t it be simpler to go the Samba route?
Autofs works with sshfs. I use it for mounting anything over a network. It automounts on demand and disconnects a mount after a period of inactivity.
Plus one for autofs, works so well that I often forget that certain files are actually remote resources
store all of the documents, desktop, downloads, etc. on a couple computers
Why use SSHFS for that? I recommend using Syncthing, it’s great for synchronizing stuff across multiple PCs (local and remote).
Why use SSHFS for that?
So that you don’t have copies of files everywhere.
What do you mean “everywhere”?
everywhere you want to use the files.
I don’t really know what that is. I could try it though.
Edit: I don’t really like having the files on all computers, I would rather just have them all in a central place where everything can access them.
Write a systemd service, that’s how my computers mount my nas. you just need to have it run under your user instead of root or point it towards the right keys manually.
I run Debian 12 and ran into similar issues trying to automount NFS, even down to having to use an alternative console to log in and undo f stab edits
My solution was simple and so hopefully it helps you as well. In fstab, the backslashes don’t cancel out spaces. Since my directory path had a space in it, that would break fstab:
Path/to/your/Video\ Files
breaks fstabPath/to/your/VideoFiles
good