Score:0

Sharing (sshfs) a folder with another Linux machine on the same home network via fstab? UBUNTU 20.04

it flag

First and foremost let me thank zx81roadkill for his excellent description of how to share a folder with another Linux machine on the same home network using sshfs. Everything has worked great for me except the last step "10. Enable reconnect after reboot" which involves modifying the fstab file.

While I can mount (and un-mount) the remote folder manually,

sudo sshfs [email protected]:/home/vanmetter /mnt/HP-2014-home -o allow_other,default_permissions -o identityfile=/home/vanmetter/.ssh/id_rsa

Mounting via the fstab file results in an error when I try to open the remote folder on my local machine.

[email protected]:/home/vanmetter/ /mnt/HP-2014-home fuse.sshfs default_permissions,user,delay_connect,reconnect,ServerAliveInterval=15,ServerAliveCountmax=3,allow_other,identityfile=/home/vanmetter/.ssh/id_rsa,idmap=user,uid=1000,gid=1000 0 0

I have even retyped the entire line to insure no 'special' characters were accidentally copied.

Clicking on the mount point for the remote folder results in a reproducible error as followings:

in Nautilus:

**Oops! Something went wrong.**
Unhandled error message: Error when getting information for file "mnt/HP-2014-home": Input/Output error

in Nemo:

Could not display "/mnt/HP-2014-home".

Error: Error when getting information for file "/mnt/HP-2014-home": Input/Output error Please select another viewer and try again.

Finally, if the folder is un-mounted, then mounted manually as shown above, everything is working fine (i.e. remote folder opens and all content are accessible).

Any help would be greatly appreciated as I now have a 99% solution to my connectivity needs.

Thanks,

Richard

Here is some further diagnostic information:

fstab contains the line:

[email protected]:/home/vanmetter/ /mnt/HP-2014-home fuse.sshfs default_permissions,user,delay_connect,reconnect,ServerAliveInterval=15,ServerAliveCountmax=3,allow_other,identityfile=/home/vanmetter/.ssh/id_rsa,idmap=user,uid=1000,gid=1000 0 0

after boot (access fails with error):

vanmetter@dell-2018:/mnt$ ls -l

ls: cannot access 'HP-2014-home': Input/output error

total 0

d????????? ? ? ? ? ? HP-2014-home

try manual sshfs mount (fails with error):

vanmetter@dell-2018:/mnt$ sudo sshfs [email protected]:/home/vanmetter /mnt/HP-2014-home -o allow_other,default_permissions -o identityfile=/home/vanmetter/.ssh/id_rsa

[sudo] password for vanmetter:

fuse: bad mount point `/mnt/HP-2014-home': Input/output error

manually un-mount (success):

vanmetter@dell-2018:/mnt$ sudo umount HP-2014-home

vanmetter@dell-2018:/mnt$ ls -l

total 4

drwxr-xr-x 2 root root 4096 Sep 6 06:16 HP-2014-home

manual sshfs mount (success)

vanmetter@dell-2018:/mnt$ sudo sshfs [email protected]:/home/vanmetter /mnt/HP-2014-home -o allow_other,default_permissions -o identityfile=/home/vanmetter/.ssh/id_rsa

[email protected]'s password:

vanmetter@dell-2018:/mnt$ ls -l

total 4

drwxrwxrwx 1 vanmetter vanmetter 4096 Sep 10 07:38 HP-2014-home

remote mount "HP-2014-home" now opens successfully in nautilus and nemo.

raph avatar
fr flag
I am myself looking for a solution on a problem quite similar. Can you mount with sshfs without sudo ? I also read somewhere that the user needs to be added to the fuse group, did you try that ? Also can you point here to zx81roadkill description you are talking about ?
it flag
1. no - I cannot mount sshfs without sudo. It generates an error message: "fusermount: user has no write access to mountpoint /mnt/Dell-2018-home". /// 2. I am a member of the fuse group. /// I'll put the link in the next comment.
it flag
Post by zx81roadkill: "https://askubuntu.com/questions/15782/how-do-i-share-a-folder-with-another-linux-machine-on-the-same-home-network" then scroll down to the second answer.
WinEunuuchs2Unix avatar
in flag
@raph Richard answered your question but omitted your name so you may not have been notified.
it flag
Thank you @WinEunuuchs2Unix. I'm a newbie on this site and appreciate your help.
it flag
Belated thank you to @zx81roadkill for your detailed instructions for connection two Linux machines on a LAN via sshfs. It works great! But I am unable to get the mount on restart to work via fstab. Any help you can offer would be greatly appreciated.
raph avatar
fr flag
For your information when trying the fstab entry from zx81roadkill I also ran into the Input/Output error. Here is the line I have, which does not create any error : `[username]@192.168.1.105:/path/to/remote/folder/ /home/[username]/path/to/local/folder fuse.sshfs default_permissions,delay_connect,noauto,_netdev,idmap=user,user,allow_other 0 0`. I can access the folder via the gnome file manager, but the folder is empty... I then need to manually sshfs in order to access to the folder content. I don't understand what's wrong on my side.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.