Could we help you? Please click the banners. We are young and desperately need the money
Using a nifty little program called SSHFS, one can mount SFTP (SSH/Secure File Transfer Protocol) file systems for convenient access. Here's how to do it.
To install SSHFS, run the following command:
apt install sshfs
We can use the sshfs command to temporarily mount an SFTP file system.
Command template:
sshfs user@host:/starting/directory/ -p 1234 -o IdentityFile=/path/to/key /mount/target/
To unmount again, use:
umount /mount/target/
To mount an SFTP file system on startup, we can add an entry to the fstab (file systems table), which is located at "/etc/fstab"
Entry template:
user@host:/starting/directory/ /mount/target/ fuse.sshfs defaults,_netdev,IdentityFile=/path/to/key,port=1234,allow_other,nofail,reconnect,ConnectTimeout=5 0 0
A prerequisite for allow_other to be available is that we add the line "user_allow_other" to the fuse.conf at "/etc/fuse.conf".
If you're looking for a more secure and controlled alternative to allow_other, you may define a user group instead (notice the "gid=foobar"):
user@host:/starting/directory/ /mount/target/ fuse.sshfs defaults,_netdev,IdentityFile=/path/to/key,port=1234,gid=foobar,nofail,reconnect,ConnectTimeout=5 0 0