Have a look at the creation of a aufo FS in this article, it works like a charm!
apt-get install sshfs fuse autofs
yay -S sshfs fuse autofs curlftpfs
We will reference a location and a directory in the next 2 config files. In /etc/auto.master you will add the root location.
Add this line to the end of your Debian: /etc/auto.master , Arch: /etc/autofs/auto.master file:
/media/sshfs /etc/auto.sshfs --timeout=30,--ghost
Be sure to leave a blank line after it.
And add the following line to /etc/auto.sshfs on Debian, /etc/autofs/auto.sshfs on Arch
backups -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536,IdentityFile=/home/user/.ssh/id_rsa :sshfs\#firstname.lastname@example.org\:/mnt/raid/proxmox_backup
Be sure to leave a blank line after it. The first piece of the line needs to be the local backup directory. The last part :sshfs\#email@example.com\:/mnt/raid/proxmox_backup is the sshfs instruction, remote username, the IP address of the “other computer”, and lastly the directory on the “other computer” to mount. The IdentityFile field is mandatory.
/etc/init.d/autofs restart ls /mnt/backups
sudo ssh -p 1234 -i /home/user/.ssh/id_rsa firstname.lastname@example.org
For better debugging you might try running automount in foreground.
sudo systemctl stop autofs.service sudo automount -f -v
fusermount -uz /data mount /data