You are not logged in.

#1 2023-08-22 07:42:36

DutchEllie
Member
Registered: 2022-02-25
Posts: 16

How to effectively mount SFTP share?

Hi everyone,

I have an SFTP server that I want to mount to my laptop as a directory. I know I can already access it using Dolphin and adding it as a network share, but that doesn't allow for very nice terminal interactions.
I read about SSHFS, but the wiki also notes that it is archived and unmaintained. Because of that, I have set mounting the share up using Rclone instead, however I am having some issues with how this is used and I had hoped someone could help me with it.
The drive is mounted in my home directory /home/username/netshare. However, when my internet is not working (or just randomly sometimes even though it is working) or when the server has issues, the filesystem sorta just locks up. Performing an ls in the /home/username directory results in that shell locking up and becoming completely unresponsive. Other programs also misbehave like Obsidian, which mounts the vault from that share as well.
I usually have to fix this by just waiting a long time until the issue resolves itself. I cannot unmount the share, because it "is busy".

That is my main issue with it. I just want a network share mounted in the specified directory that always works and most importantly never blocks me. If I don't have internet, I would expect Rclone to just cache the writes and sync them whenever I regain internet connectivity.

I have my configuration here. The following is my rclone.conf file (with redactions)

[share]
type = sftp
host = [redacted]
user = username
key_file = /home/username/.ssh/id_ed25519
shell_type = unix
md5sum_command = none
sha1sum_command = none
timeout = 30s
contimeout = 10s

And here is what I do in my /etc/fstab:

# Netshare sftp
share:/username    /home/username/netshare       rclone  rw,auto,nofail,user,_netdev,x-systemd.automount,args2env,allow_other,vfs_cache_mode=writes,config=/home/username/.config/rclone/rclone.conf,cache_dir=/home/username/.rclonecache         0 0

I'm pretty sure I'm only missing an option somewhere, but I've tried a lot so far and just can't figure it out... I hope someone can help me! Thanks in advance!

Offline

#2 2023-08-23 14:39:13

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,453

Re: How to effectively mount SFTP share?

The best solution would be to add NFS or Samba to your SFTP server and use a proper distributed file system protocol instead of SFTP. If you wish (or have to) stick with SFTP, then I think the only solution is the now unmaintained SSHFS. IIRC it was widely used, so it'll likely work still.

Offline

Board footer

Powered by FluxBB