sshfs-win-manager icon indicating copy to clipboard operation
sshfs-win-manager copied to clipboard

Cannot connect to host with Ssh-key

Open krot4u opened this issue 3 years ago • 4 comments

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@<Ip_address>:/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 <IP_address> [<IP_address>] 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@<IP_address>: Permission denied (publickey). read: Connection reset by peer {8875ce56-8f2f-4337-b2fd-5a4f06be2128} exit: 1

krot4u avatar Jun 25 '22 10:06 krot4u

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@<IP_address>: Permission denied (publickey).

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

evsar3 avatar Jul 14 '22 18:07 evsar3

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@<IP_address>: 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

krot4u avatar Jul 14 '22 20:07 krot4u

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@<IP_address>: 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).

Lotharyx avatar Apr 17 '23 15:04 Lotharyx

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

JackTian996 avatar Dec 08 '23 03:12 JackTian996