Bug #49812 Unable to use SSH connection with key file
Submitted: 18 Dec 2009 21:03 Modified: 15 Jan 2010 15:03
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:5.1.11 OS:Windows (XP)
Assigned to: Alfredo Kojima CPU Architecture:Any

[18 Dec 2009 21:03] Todd Farmer
Description:
When I try to create a connection to a remote server using SSH with a key file, I receive various errors when testing the connection:

D:/Documents and Settings/tf221715/.ssh/id_dsa
"D:/Documents and Settings/tf221715/.ssh/id_dsa"
D:\Documents and Settings\tf221715\.ssh\id_dsa
"D:\Documents and Settings\tf221715\.ssh\id_dsa"

When it is quoted, I receive the following error:

Cannot open SSH Tunnel:  ERROR Invalid request

When not quoted, I receive the following error:

Could not connect SSH tunnel:  ERROR [Errno 22] invalid mode ('r') or filename:
'D:\\Documents and Settings\\tf221715\\.ssh\\id_dsa'

Just for fun, I decided to use the putty private key, and set it to 

D:\Documents and Settings\tf221715\.ssh\private.ppk
"D:\Documents and Settings\tf221715\.ssh\private.ppk"

Same results, including the reference to the "id_dsa" filename, even though I had changed the value of the key filename before testing.

How to repeat:
See above

Suggested fix:
Help key-based SSH on Windows to work.
[5 Jan 2010 1:49] Alfredo Kojima
Bug was fixed.
[13 Jan 2010 17:24] Johannes Taxacher
the fix will be included in 5.2.12.
note for documentation: only openssh key format is supported right now (no putty keys. but puttygen can export/convert from/into openssh keys)
[15 Jan 2010 15:03] Tony Bedford
I have added a note on OpenSSH keys to the main documentation.

Also, entry added to the 5.2.12 changelog:

In the Manage DB Connections dialog, when attempting to create a Standard TCP/IP over SSH connection, errors occurred when testing the connection in the case where a key file had been specified. If the path to the key file was quoted the error was:

Cannot open SSH Tunnel:  ERROR Invalid request

If the same path was not quoted the error generated was:

Could not connect SSH tunnel:  ERROR [Errno 22] invalid mode ('r') or filename:
'D:\\Documents and Settings\\tf221715\\.ssh\\id_dsa'

It should be noted that currently only key files using the OpenSSH format are supported.