Ticket #157 (closed defect: fixed)

Opened 8 years ago

Last modified 5 years ago

Unable to access directory: Unknown key format

Reported by: Jan K. Owned by: alamaison
Priority: critical (affects core workflow) Milestone: 0.90 Beta 1
Component: host-key Version: 0.6.0
Keywords: Cc:

Description

Hi.

I added a connection to an Ubuntu 10.04 Machine. When double-clicking the connection I immediately get an error dialog saying "Unable to access directory". Details then show "Unknown key format"... whatever that means.

I have a cygwin Installation with SSH running on this machine... could this make a difference?

Attachments

swish.png Download (18.1 KB) - added by JK 8 years ago.
Error dialog
known_hosts.faulty Download (38.7 KB) - added by anonymous 7 years ago.
example file that causes the issue

Change History

Changed 8 years ago by JK

Error dialog

comment:1 Changed 8 years ago by anonymous

Addendum: The difference to Ticket #107 is that I do not even get a password dialog.

comment:2 in reply to: ↑ description Changed 8 years ago by alamaison

Replying to Jan K.:

I added a connection to an Ubuntu 10.04 Machine. When double-clicking the connection I immediately get an error dialog saying "Unable to access directory". Details then show "Unknown key format"... whatever that means.

At a guess, it is encountering a problem when exchanging the keys used to encrypt the channel - one of the first things that happens when opening an SSH connection. Can you tell us the type and version of SSH server running on the server you are trying to connect to?

I have a cygwin Installation with SSH running on this machine... could this make a difference?

Nothing is impossible but I very much doubt this has any effect on it. Swish uses libssh2 to communicate over SSH. It doesn't call any external SSH program so Cygwin shouldn't be able to get in the way.

comment:3 follow-up: ↓ 4 Changed 7 years ago by anonymous

Seeing the same thing going from Win7 to Suse Enterprise Desktop 10.

Never get a password prompt. Dialog says "Unable to access the directory" with details "Unknown key format". Connection between these boxes works fine with cygwin ssh client or putty ssh client. They do usually make me accept the host key on first connect.

I am using my cygwin home == C:\Users\me. Would they be using the same config files or directories?

comment:4 in reply to: ↑ 3 Changed 7 years ago by anonymous

p.s. both are 64 bit versions of the OS.

Replying to anonymous:

Seeing the same thing going from Win7 to Suse Enterprise Desktop 10.

comment:5 Changed 7 years ago by alamaison

So it turns out my earlier guess was wrong. What's happening here is that Swish (libssh2 really) doesn't like your locally recorded host key file.

In case you're not familiar with SSH, host keys are a security feature that help you realise when a malicious third-party is pretending to be the server you are connecting to. When a client connects to a server it looks at the server's 'host key' and looks up the value it was expecting to receive (the value it received last time) and warns you if they don't match. These keys are stored in a file called known_hosts in %HOME%\.ssh so on your system this file is probably found at C:\Users\me\.ssh\known_hosts.

In your case, libssh2 has not been able to parse this file. Either your file has become corrupted or it uses an unusual form that libssh2 doesn't support yet. In both cases, I'd be curious to see what is in this file so we can improve Swish's behaviour.

As a workaround, rename known_hosts to something else and try again.

comment:6 Changed 7 years ago by alamaison

  • Owner changed from jk to alamaison
  • Priority changed from critical (affects core workflow) to minor (e.g. uncommon, cosmetic)
  • Status changed from new to accepted
  • Milestone set to 0.90 Beta 1

Changed 7 years ago by anonymous

example file that causes the issue

comment:7 Changed 7 years ago by anonymous

If I'm not mistaken, OpenSSH changed the format of this file somewhere in the way, however it can ready both old and new-style lines in it.

I've been using the above file for the past few years, moving it between Linux and Windows (Cygwin) hosts.

Thank you for your work!

comment:8 Changed 6 years ago by anonymous

This isn't really minor for me -- I can't simply rename known_hosts since I need to use it with my Cygwin ssh install.

comment:9 Changed 5 years ago by anonymous

This fixed my issues! Thanks!

comment:10 Changed 5 years ago by alamaison

  • Priority changed from minor (e.g. uncommon, cosmetic, has workaround) to critical (affects core workflow)
  • Resolution set to fixed
  • Status changed from accepted to closed
  • Component changed from authentication to host-key

Our pleasure. Thanks for reminding us to close the bug report :P

Fixed in [b4a1dab8/swish].

Note: See TracTickets for help on using tickets.