sshfs and public keys

Red Squirrel

No Lifer
May 24, 2003
71,312
14,084
126
www.anyf.ca
I'm trying to use sshfs to mount a share so I can share it through samba, as I cannot access a samba share over a NAT. So I have to mount it locally via ssh then access it locally from Windows.

This is the command I"m trying:

sshfs -p 22 -i=~/sshkeys/extsrv.loc filesync@extsrv.loc:/mnt/ravagerapplications . -o nonempty -o allow_other -o PasswordAuthentication=no

Does not seem to work. I get a log entry on the server of a connection then disconnection.

I also get this on the machine I'm trying to sshfs from:

read: Connection reset by peer


Anything I'm doing wrong in the command? I'm running this as root. (not sudo)
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
I've never used sshfs, but I have a few thoughts. First of all, I've never used multiple "-o" switches and I'm not sure if it's valid to do it that way. I would try combining all the options into one switch like this: "-o nonempty,allow_other,PasswordAuthentication=no"

Second thing is, you could add sshfs_debug to the options to, hopefully, get some sort of more descriptive error message. So your -o switch would look like this: "-o sshfs_debug,nonempty,allow_other,PasswordAuthentication=no"

Also, a quick google search suggests to make sure this line exists in your /etc/ssh/sshd_config:

"Subsystem sftp /usr/lib/ssh/sftp-server"

You might also make sure that file exists.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
If sshfs is anything like sftp you need to specify the port using -o Port=22 and not -p 22... then again why are you specifying the default port for ssh? It's default for a reason!
 

Red Squirrel

No Lifer
May 24, 2003
71,312
14,084
126
www.anyf.ca
I tried seperating the options by a comma but I get more errors about those options being invalid. I was just basing it on examples I"ve seen.

Also I've noticed that when using ssh from another server it uses that server's default port (which was not 22 in my case.)
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Originally posted by: RedSquirrel
I tried seperating the options by a comma but I get more errors about those options being invalid. I was just basing it on examples I"ve seen.

Also I've noticed that when using ssh from another server it uses that server's default port (which was not 22 in my case.)

The port is specified in /etc/ssh/ssh_config for the ssh client program. You probably changed the port in there thinking it was sshd_config by accident.
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Originally posted by: RedSquirrel
I tried seperating the options by a comma but I get more errors about those options being invalid. I was just basing it on examples I"ve seen.

Also I've noticed that when using ssh from another server it uses that server's default port (which was not 22 in my case.)

hmm, well it was just a guess since every single mount command I've ever used worked that way, but as I said, I've never used sshfs.