autofs

sudo apt install autofs sudo mkdir /etc/auto.master.d/

debugging

stop service and run foreground

systemctl stop autofs sudo automount -f -v

sshfs

sudo apt install sshfs

autofs use root account and ssh key has to be present in /root/.ssh

sudo su - ssh-keygen

copy idrsa.pub in destination ~/.ssh/authorizedkeys and check

ssh <user>@destination

1000 is id of local user

/mnt/sshfs /etc/auto.sshfs uid=1000,gid=1000,--timeout=30,--ghost
subfolderblabla -fstype=fuse,rw,nodev,nonempty,noatime,allow_other,max_read=65536 :sshfs\#remote_user@destinatio.remote\:/path/to/mount