4

My system is 32-bit so this answer doesn't help me.

I am trying to use sshfs to no avail:

$ sshfs -o IdentityFile=/home/aventinus/.ssh/id_rsa [name]@X.X.X.X:/data/[folder name]/[folder name]/ /home/aventinus/[folder name]/
SSHFS version 2.5
fuse: bad mount point `IdentityFile=/home/aventinus/.ssh/id_rsa': No such file or directory

But this makes no sense because:

$ cd /home/[user]/.ssh/
$ ls -l
total 12
-rw-rw-rw- 1 aventinus aventinus 1679 Sep 19 17:22 id_rsa
-rw-rw-rw- 1 aventinus aventinus  408 Sep 19 17:22 id_rsa.pub
-rw-rw-rw- 1 aventinus aventinus 1326 Sep 20 09:18 known_hosts

What am I doing wrong? The files are indeed there but I get "No such file or directory". Also, when I try to get them using bash, pressing tab doesn't autocomplete the name of the files. How is this possible?

edit 1: I know that the permissions on the files are over-permissive as @steeldriver mentioned in the comments. I did that in order to make sure that permissions is not the problem. I was running out of ideas.

edit 2: After @Jakuje's comments:

$ set -x
+ set -x
$ sshfs -o sshfs_debug [name]@X.X.X.X:/data/[folder name]/[folder name]/ /home/aventinus/[folder name]/
+ sshfs -o sshfs_debug [name]@X.X.X.X:/data/[folder name]/[folder name]/ /home/aventinus/[folder name]/
SSHFS version 2.5
read: Connection reset by peer

edit 3: After @Jakuje's answer:

$ sshfs [name]@X.X.X.X:/data/[folder name]/[folder name]/ /home/aventinus/[folder name]/ -o IdentityFile=/home/aventinus/.ssh/id_rsa
read: Connection reset by peer

Also:

$ sshfs [name]@X.X.X.X:/data/[folder name]/[folder name]/ /home/aventinus/[folder name]/ -o sshfs_debug -o IdentityFile=/home/aventinus/.ssh/id_rsa
SSHFS version 2.5
fuse: invalid argument `IdentityFile=/home/aventinus/.ssh/id_rsa'

So indeed, for some reason, sshfs cannot read the id_rsa file but as I have shown you, it is there. How is this possible?

edit 4: After @Jakuje's comments on his answer:

$ sshfs [name]@X.X.X.X:/data/[folder name]/[folder name]/ /home/aventinus/[folder name]/ -o LogLevel=DEBUG3 -o IdentityFile=/home/aventinus/.ssh/id_rsa
read: Connection reset by peer

Also:

$ sshfs [name]@X.X.X.X:/data/[folder name]/[folder name]/ /home/aventinus/[folder name]/ -d -o debug -o IdentityFile=/home/aventinus/.ssh/id_rsa
FUSE library version: 2.9.4
nullpath_ok: 0
nopath: 0
utime_omit_ok: 0
ssh: connect to host X.X.X.X port 22: Connection timed out
read: Connection reset by peer

I really don't understand this.

15
  • The bad mount point message is puzzling - but one thing that leaps out is the over-permissive permissions (the id_rsa file should be mode 600 - and the parent .ssh dir mode 700) Sep 20, 2016 at 9:46
  • @steeldriver I changed the permissions of the files in order to make sure that this is not the problem. Yes, they are over-permissive and I will change them back. I was just running out of ideas.
    – Aventinus
    Sep 20, 2016 at 9:49
  • I don't see a ~/.ssh/config file - but you have an ssh_config file entry for the target server either there or elsewhere? Sep 20, 2016 at 9:53
  • @steeldriver I don't have one probably. I just followed this (cyberciti.biz/faq/linux-unix-generating-ssh-keys) guide to generate my ssh keys. I sent my pub key to the server admin and he added me. According to this guide I should be able to connect, correct? Do I need to create a config file manually?
    – Aventinus
    Sep 20, 2016 at 9:57
  • 1
    I see that this is the error about location of the key, but I don't see how you specify that nor in the first command nor in the second.
    – Jakuje
    Sep 20, 2016 at 10:25

3 Answers 3

1

The order of the synopsis matters:

sshfs [user@]host:[dir] mountpoint [options]

Therefore you should use

$ sshfs [user@server] [/path/to/mountpoint] -o IdentityFile=/home/[user]/.ssh/id_rsa

as manual page for sshfs suggests.

Edit: You can't even ping the host, so the problem is in the network. Check if there is some firewall on the way or something else blocking the connection.

11
  • Thank you for your answer. Unfortunately, this didn't solve my problem. I have updated the question, please check edit 3.
    – Aventinus
    Sep 20, 2016 at 10:38
  • It solved your original problem. The thing you are not able to authenticate to the server or start sftp is other problem. Anyway, if you want to run in debug mode, add -o sshfs_debug -o IdentityFile=/home/aventinus/.ssh/id_rsa (note the additional -o you missed in you command).
    – Jakuje
    Sep 20, 2016 at 10:40
  • My original problem was the fact the fuse: bad mount point IdentityFile=/home/aventinus/.ssh/id_rsa': No such file or directory which I'm guessing is the reason I cannot connect to the server. As for the missing -o, I added it and the output is identical so updated the post to reflect on that. Thank for your time, I really appreciate it.
    – Aventinus
    Sep 20, 2016 at 10:46
  • Try -o LogLevel=DEBUG3 too.
    – Jakuje
    Sep 20, 2016 at 10:48
  • Identical output. I updated the question to include it. Really, how is this possible?
    – Aventinus
    Sep 20, 2016 at 10:54
0

You are getting the connection reset error.

Please try adding your public key to the authorizedkey of remote.

0

I had a similar issue and (eventually) when I just ssh'd directly to the other machine I got a warning about IP address changes... and yes over the weekend the machine had changed IP address. So I removed the offending line from .ssh/known_hosts and ssh'd over again no problem. Then when I used my sshfs string that had been working until this weekend it worked fine. Not a helpful error message at all in this case!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .