Can you ssh into the router? If not, the following is all a moot point. If so you could possibly set up your client with ssh keys and then you could mount the drive/s in fstab. There are plenty of YouTube videos of setting up ssh keys and copying the public key over to the remote/router, so I won’t try to cover all of that here.
I am posting the instructions I used to setup my keys and get all of this working. I would love to give credit to the person that did it, but I don’t remember where it came from.
I did a search and found it at networking - How do I share a folder with another Linux machine on the same home network? - Ask Ubuntu I just hope the forum lets me share the link.
I find SSHFS to be native, stable and extremely fast. I have two xubuntu machines (18.04) sharing /home folders and an Intel NUC as 'dropbox' USB stick. All over sshfs.
UPDATE 2020-07-12: I found SSHFS for Windows. A clean beautiful GUI, zero config and works with the SSH keys from linux-machines.
• Howto: https://github.com/billziss-gh/sshfs-win
• GUI https://github.com/evsar3/sshfs-win-manager
Here's how to set this up sshfs and automatically reconnecting after a reboot using fstab without having to provide a password. A big thank you to serverfault user kubanczyk for how to reconnect after a remote suspend/resume.
I'll use "Local machine - surfbox" for computer you're connecting from, and "Remote machine - devbox" for the computer you're connecting to.
Check your userID och groupID, they should both be 1000.
GroupID: id -g localuser UserID: id -u localuser
1. Get IP-adresses of your Local & Remote Machines.
hostname -I
I'll use 192.168.1.150 for Local Machine ('surfbox') and 192.168.1.151 for Remote Machine ('devbox')
2. Install packages on Local and Remote Machines
sudo apt install sshfs fuse ssh
3. Create a group fuse and add localuser to it
Create group: sudo groupadd fuse
Add localuser to the group: sudo usermod -a -G fuse $USER
4. Enable "allow_other" in fuse config
We will need this option when mounting in fstab
Edit /etc/fuse.conf with your command line editor. Remove the hashtag before user_allow_other and save.
5. Generate SSH keys on Local Machine
Do not provide a password when prompted. Just press Enter to leave blank.
ssh-keygen -t rsa -C youremail@example.com
Keys are stored in Local machine home directory /.ssh folder
6. Transfer your Local machine public SSH key to the Remote machine
ssh-copy-id -i ~/.ssh/id_rsa.pub remoteuser@192.168.1.151
You will be prompted for password for Remote user on Remote machine. Local machine public key is now added to the file ~/.ssh/authorized_keys on Remote machine.
7. Create a directory on Local machine /mnt folder where you will mount the Remote machine /home folder.
Choose any name which makes sense for your Remote machine.
sudo mkdir /mnt/devboxhome
8. Mount the Remote machine /home directory from terminal
Syntax for sshfs is
sshfs [user@]host:[directory] mountpoint [options]
we use
sudo sshfs [remoteuser]@192.168.1.151:/home/[remoteuser] /mnt/devboxhome -o allow_other,default_permissions -o identityfile=/home/[localuser]/.ssh/id_rsa
example: assuming "steve" is the username on both Local and Remote machines
sudo sshfs steve@192.168.1.151:/home/steve /mnt/devboxhome -o allow_other,default_permissions -o identityfile=/home/steve/.ssh/id_rsa
Since you have transferred the public RSA key to Remote machine you should not be prompted for remoteuser password.
You will get a warning that the machine is not trusted and prompted if it should be added. Add the Remote machine as trusted.
9. Verify: Browse Remote Machine /home directory
In terminal on Local machine you can now list Remote machine /home directory under /mnt/devboxhome
cd /mnt/devboxhome ls
or use Nautilus to browse the directory. Great.
10. Enable reconnect after reboot
We will add an entry in /etc/fstab to make this happen. You will need your Local machine userid och groupid - see intro if you missed this. Edit /etc/fstab with your command line editor and add these two lines at the end of /etc/fstab
# Mount devbox at boot remoteuser@192.168.1.151:/home/[remoteuser]/ /mnt/devboxhome fuse.sshfs default_permissions,user,delay_connect,reconnect,ServerAliveInterval=15,ServerAliveCountmax=3,allow_other,identityfile=/home/[localuser]/.ssh/id_rsa,idmap=user,uid=1000,gid=1000 0 0
• delay_connect makes the kernel wait until the network is up until it tries to mount the directory on Remote machine.
• Since we are running as root during boot we have to specify the keyfile which is stored in localuser home directory.
• allow_other - users other than the one doing the actual mounting can access the mounted filesystem.
• idmap=user - only translate UID of connecting user
• reconnect, ServerAliveInterval, ServerAliveCountMax - ssh sends keep-alive pings. If ServerAliveCountMax consecutive pings fail, reconnect.
A user logging in as steve on Local and Remote machines would have:
steve@192.168.1.151:/home/steve /mnt/devboxhome fuse.sshfs default_permissions,user,delay_connect,reconnect,ServerAliveInterval=15,ServerAliveCountmax=3,allow_other,identityfile=/home/steve/.ssh/id_rsa,idmap=user,uid=1000,gid=1000 0 0
IMPORTANT: a slash after remote directory: steve@192.168.1.151:/home/steve/
save /etc/fstab and ....
11. Reboot
You should now be able to access Remote machine /home directory in the Local machine /mnt/devboxhome In Nautilus you can drag this folder to the Places bar
12. Repeat
Go through the same steps again on Remote machine to make the /home directory of Local machine shared.
Here are a couple of lines from my /etc/fstab on my laptop that mounts the shared drives on my desktop pc. The hard part is getting the ssh keys done and that is not very difficult.
Below, heisenberg is the desktop. The two drives are one HDD and one SSD. There is no difference between them as far as mounting is concerned. You could use the IP Address instead of the PC Name.
wilson@heisenberg:/4TB-HDD /mnt/4TB-HDD fuse.sshfs default_permissions,user,delay_connect,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,allow_other,identityfile=/home/wilson/.ssh/id_rsa,idmap=user,uid=1000,gid=1000 0 0
wilson@heisenberg:/HomeBack /mnt/HomeBack fuse.sshfs default_permissions,user,delay_connect,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,allow_other,identityfile=/home/wilson/.ssh/id_rsa,idmap=user,uid=1000,gid=1000 0 0
By the way, these are not SMB shares. It’s not needed. I don’t think you have to install fuse on the router. I know it has to be installed on your PC to mount the drive/s. I could be wrong on this though. Maybe someone else can chime in.