Sunday, April 28, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 33836  / 1 Year ago, tue, april 11, 2023, 8:41:44

I created a key pair to connect to a Synology disk from 12.04. Deployed, edit ~/.ssh/config to automatically use it. Tested:



ssh user@remotesynology


-> works like a charm. Tested on a second remote machine (running Ubuntu server) -> works.



Now tested:



sshfs user@theubuntuserver: /home/user/ubuntuserver


-> works



Finally:



sshfs user@remotesynology: /home/user/remotesynology


-> error:



read: Connection reset by peer


I had a look at this issue, but that doesn't seem to apply (I have the user in the fuse group, and it works for the other machine) and I don't get a permission denied error.



What do I miss?


More From » authentication

 Answers
0

I've had issues in the past where sshfs was acting weird. First thing you really should do after installing sshfs is restart your machine, or at least X, once you've added yourself to the fuse group.



This error is typically seen when a user is not in the fuse group, or if allow_other in fuse is not enabled.



There have been times where my ssh key was causing issues. I've had to explicitly tell sshfs what key file to use, even when ssh was configured for it (~/.ssh/config).




  • sshfs -oIdentityFile=/full/path/to/id_rsa user@machine



Another solution is to use your /etc/fstab and add a new entry here:



sshfs#USER@MACHINE:/remote/path/ /mnt/local/path/      fuse    user,_netdev,auto_cache,reconnect,uid=1000,gid=1000,IdentityFile=/full/path/to/.ssh/id_rsa,idmap=user,allow_other    0       2


This tells your machine to mount /remote/path to /mnt/local/path. It's saying that this mount will be a fuse filesystem. There are a few other settings that allow things such as mounting when networking becomes available, automatically re-connecting if there is a disconnect, etc.



The idmap and allow_other portion allow users within the fuse group to mount the filesystem. It will also help map the permissions to match up to the user and group also specified.



In this example, you could then run the following to get the filesytem mounted:




  • mount /mnt/local/path/

  • ls /mnt/local/path/


[#38234] Tuesday, April 11, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
armis

Total Points: 38
Total Questions: 106
Total Answers: 118

Location: Mali
Member since Sat, Feb 12, 2022
2 Years ago
;