evsar3 / sshfs-win-manager

A GUI for SSHFS-Win (https://github.com/billziss-gh/sshfs-win)
MIT License
1.11k stars 84 forks source link

Cannot connect to host with Ssh-key #156

Open krot4u opened 2 years ago

krot4u commented 2 years ago

Hi! Here is the steps to reproduce. 1) ssh-keygen -t rsa -b 2048 (or 4096) on host - empty password 2) Put pub key in authorized_keys 3) get Private key and put it to sshfs-win-manager Connection properties 4) Click connect Getting an error in debug view: date: 2022-06-25T10:28:53.193Z conn: {8875ce56-8f2f-4337-b2fd-5a4f06be2128} (ConnectionName) conntype: key-file cmd: "C:\Program Files\SSHFS-Win\bin\sshfs.exe" root@:/root/site D: -p5322 -ovolname=hamradio -odebug -ologlevel=debug1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oumask=000 -oPreferredAuthentications=publickey -oIdentityFile="C:/Users/User/inferno_hamradio_ssh_rsa" {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: SSHFS version 3.7.1 {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: executing <-x> <-a> <-oClearAllForwardings=yes> <-oPort=5322> <-ologlevel=debug1> <-oStrictHostKeyChecking=no> <-oUserKnownHostsFile=/dev/null> <-oPreferredAuthentications=publickey> <-oIdentityFile="C:/Users/User/inferno_hamradio_ssh_rsa"> <-2> root@<IP_address> <-s> {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: debug1: Connecting to [] port 5322. {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: debug1: Connection established. {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: debug1: identity file C:/Users/User/inferno_hamradio_ssh_rsa type -1 debug1: identity file C:/Users/User/inferno_hamradio_ssh_rsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.4 {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: debug1: SSH2_MSG_KEXINIT sent {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: debug1: Server host key: ecdsa-sha2-nistp256 SHA256:IoIupHFuZCTEjdwCTT2stM5x2Zl/vfHu2ETq3d7L9RQ debug1: checking without port identifier {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: debug1: SSH2_MSG_SERVICE_ACCEPT received {8875ce56-8f2f-4337-b2fd-5a4f06be2128} stderr: debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: C:/Users/User/inferno_hamradio_ssh_rsa Load key "C:/Users/User/inferno_hamradio_ssh_rsa": invalid format debug1: No more authentication methods to try. root@: Permission denied (publickey). read: Connection reset by peer {8875ce56-8f2f-4337-b2fd-5a4f06be2128} exit: 1

evsar3 commented 2 years ago

debug1: Trying private key: C:/Users/User/inferno_hamradio_ssh_rsa Load key "C:/Users/User/inferno_hamradio_ssh_rsa": invalid format debug1: No more authentication methods to try. root@: Permission denied (publickey).

Check your key format is compatible with your server and if it is authorized to connect.

krot4u commented 2 years ago

debug1: Trying private key: C:/Users/User/inferno_hamradio_ssh_rsa Load key "C:/Users/User/inferno_hamradio_ssh_rsa": invalid format debug1: No more authentication methods to try. root@: Permission denied (publickey).

Check your key format is compatible with your server and if it is authorized to connect.

I can authorize with this key via ssh with no problem

Lotharyx commented 1 year ago

debug1: Trying private key: C:/Users/User/inferno_hamradio_ssh_rsa Load key "C:/Users/User/inferno_hamradio_ssh_rsa": invalid format debug1: No more authentication methods to try. root@: Permission denied (publickey).

Check your key format is compatible with your server and if it is authorized to connect.

I can authorize with this key via ssh with no problem

The idea here is that your private key file needs to be in a format that sshfs understands. For example, PuTTY (a very popular Windows SSH client) writes private key files one way, and OpenSSH writes them a different way (I don't know the specifics offhand).

JackTian996 commented 9 months ago

I have the same error. And my private key is OpenSSH format.