To do this I used a program called SSHFS which has done a great job. First, install if from the repo
sudo apt-get install sshfs
You’ll need to create a directory to use as the location for your files
sudo mkdir /mnt/sshftps
Execute the command to connect the actual SFTP Server. Replace xxx.xxx with the target IP address and use the -p option to specify the connection port. The user parameter is your user name. The :/ at the end of the IP address indicates the end of the IP address. Don’t try to put the port number after the colon
sudo sshfs -o allow_other -p 6789 user@xxx.xx.xxx.xx:/ /mnt/sshftps
This will create a semi-permanent connection which will close if the machine is restarted. You can create a permanent connection which will reopen when the machine starts by editing the fstab file in /etc/fstab. Add a command to the end and restart the machine. Personally, I haven’t tried this because it’s a potential security risk and I didn’t need 100% uptime.
sshfs#username@xxx.xxx.xxx.xxx:/ /mnt/sshftp
hi tyvm for the post helped me to find a new solution to use. i do wish to add the auto mount command to fstab but my sftp server needs a password, would you please be so kind to put an example to auto map using fstab entry with a password (this is for home use and im aware of security risk) but i would like to use this.
Unfortunately, I was not able to find a way to have fstab automatically authenticate with a password. This post has some useful information to get you started
https://unix.stackexchange.com/questions/29250/sshfs-always-asking-for-password-in-fstab
this explains how to do that…
https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh
I was googling for instructions to give a co-worker.
You can make a systemd entry and mount on boot as a system service
https://github.com/rharmonson/richtech/wiki/Mounting-CIFS-Shares-on-CentOS-7
This isn’t mounting using SFTP?! It’s mounting using SSHFS! Both provide file access over SSH, but they are not the same thing…
Exactly.
Uhm… I’m pretty sure SSHFS is just a fuse abstraction for using SFTP to access files like a native FS… It IS SFTP.
Thank you so much for this guide. It’s 2022 and it’s still being helphful.