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.

Aventinus
  • 206
  • 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) – steeldriver Sep 20 '16 at 09: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 '16 at 09: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? – steeldriver Sep 20 '16 at 09:53
  • @steeldriver I don't have one probably. I just followed this (http://www.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 '16 at 09:57
  • What command are you running? Use set -x to see what is actually executed. Looks like some alias mess. – Jakuje Sep 20 '16 at 10:09
  • @jakuje set -x does nothing. What do you mean "What command are you running"? About what exactly? – Aventinus Sep 20 '16 at 10:13
  • $ sshfs -o sshfs_debug [user@server] [/path/to/mountpoint] with at least more realistic arguments. Run the command after setting set -x and update the question with the output. – Jakuje Sep 20 '16 at 10:14
  • @jakuje Updated. Thank you for your help so far. – Aventinus Sep 20 '16 at 10:21
  • So where did the above discussed error disappeared? – Jakuje Sep 20 '16 at 10:21
  • @jakuje If you see the first input you'll see that the fuse: bad mount point comes up when I try to specify the location of the key. – Aventinus Sep 20 '16 at 10:24
  • 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 '16 at 10:25
  • @jakuje Yes, because I'm stupid. I had typed an incorrect command. I updated the post, check again please. (probably this is why I got downvoted). – Aventinus Sep 20 '16 at 10:28
  • fyi that's why I was asking about an ssh_config file - because I couldn't see anywhere you were specifying the IdentityFile mentioned in the error – steeldriver Sep 20 '16 at 12:13
  • @steeldriver I see, yet I don't know to create one. Any guides? – Aventinus Sep 20 '16 at 12:18
  • Are you trying to connect to a server you control (at home or otherwise) through its WAN IP? If so, have you changed any router settings? – alex_d Sep 20 '16 at 13:10

3 Answers3

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.

Jakuje
  • 6,605
  • 7
  • 30
  • 37
  • Thank you for your answer. Unfortunately, this didn't solve my problem. I have updated the question, please check edit 3. – Aventinus Sep 20 '16 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 '16 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 '16 at 10:46
  • Try -o LogLevel=DEBUG3 too. – Jakuje Sep 20 '16 at 10:48
  • Identical output. I updated the question to include it. Really, how is this possible? – Aventinus Sep 20 '16 at 10:54
  • Weird ... -d -o debug changes something? – Jakuje Sep 20 '16 at 10:56
  • fuse: invalid argument 'IdentityFile=/home/aventinus/.ssh/id_rsa' :/ I updated the question. – Aventinus Sep 20 '16 at 11:01
  • of course you need to leave the -o in front of the IdentityFile option ... – Jakuje Sep 20 '16 at 11:02
  • Of course. I updated my question. See edit 4 again. – Aventinus Sep 20 '16 at 11:07
  • Connection timed out Seems like some network error. Can you ping the 128.16.6.218 at least? Some firewall on the way? – Jakuje Sep 20 '16 at 11:08
  • Pinging does nothing:

    $ ping X.X.X.X ^C --- X.X.X.X ping statistics --- 9 packets transmitted, 0 received, 100% packet loss, time 8062ms

    Also, can you remove the actual address. I left it by mistake. It might be not a good idea...

    – Aventinus Sep 20 '16 at 11:10
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!

Sean
  • 181
0

You are getting the connection reset error.

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

Samir Jha
  • 1
  • 1