Bug #50779 Cannot connect to server administration tool using SSH with RSA key
Submitted: 1 Feb 2010 7:42 Modified: 2 Feb 2011 8:29
Reporter: Jeremy Bell Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:5.2.31a OS:Windows (Windows 7 x64)
Assigned to: CPU Architecture:Any
Tags: can't connect, pem key, rsa key

[1 Feb 2010 7:42] Jeremy Bell
Description:
I'm unable to connect to the server administration section of Workbench using SSH with an RSA key in a .pem file. I get error message "Could not establish SSH connection: not a valid DSA private key file."

This did not work in 5.2.11, but worked in 5.2.14.

I doubt it matters, but the MySQL server version is 5.1.42

How to repeat:
1. Create a new server instance for server administration using an RSA key.
2. Attempt to connect to the server instance, error message is displayed.

Suggested fix:
Improve Workbench code to detect RSA key as opposed to DSA key, and successfully connect to server via SSH.
[1 Feb 2010 12:25] Maksym Yehorov
Jeremy,

Do you use rsa key for ssh v1 or v2? WB only supports DSA and RSA keys for SSH v2.
[2 Feb 2010 0:28] Jeremy Bell
Server config reveals it is SSH v2.

If it helps, the format of the .pem file is:

"# SSH host keys collected by paramiko
174.129.xxx.xxx ssh-rsa [KEY_STRING]"

It is a key file downloaded straight from Amazon for use with their EC2 instances.
[8 Feb 2010 10:12] austin woz
i am having similar issue. version 5.2.15b
i have this installed on both mac and PC. Using the same key file on both computers i am able to connect with the mac, but not the PC. The Pc gives me the message "Could not establish SSH connection: not a valid DSA private key file."
This key file works fine when using my ssh client. 
tell me where to find log files in win XP and i will post them here
[10 Feb 2010 11:55] Susanne Ebrecht
This could be related to Bug #49090
[12 Mar 2010 16:22] Travis McMurry
I just upgraded to 5.2.16 (5249) and this problem still exists.  Querying is fine, but Server Administration doesn't work.  This is problematic for users running MySQL on Amazon EC2 as the default way to interact with the system is with a SSH v2 key.  

My Host OS is Windows 7 x64.
[10 May 2010 22:47] MySQL Verification Team
Could you please try version 5.2.20. Thanks in advance.
[10 May 2010 23:14] Jeremy Bell
While setting up a new connection for server administration. On the test settings screen I get:

--------------------------------------------------

Connecting to 174.129.216.46

Traceback (most recent call last):

  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 OSS/modules\wb_admin_grt.py", line 320, in testInstanceSettingByName

    test_ssh_connection = wb_admin_control_be.MyCtrl(server_instance, connect_sql=False)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 OSS/modules\wb_admin_control_be.py", line 542, in __init__

    self.ssh = SSH(self.settings)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 OSS/modules\wb_admin_control_be.py", line 374, in __init__

    self.ssh.wrapped_connect(settings)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 OSS/modules\wb_admin_ssh.py", line 158, in wrapped_connect

    self.connect(host, port, loginInfo['ssh.userName'], pwd, usekey, key_filename)

  File "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 OSS/modules\wb_admin_ssh.py", line 203, in connect

    raise ConnectionError("Could not establish SSH connection: %s." % exc)

ConnectionError: Could not establish SSH connection: not a valid DSA private key file.

Operation failed: Could not establish SSH connection: not a valid DSA private key file.

--------------------------------------------------

So no, it still doesn't work in 5.2.20.
[12 Jun 2010 7:40] Susanne Ebrecht
Do you still have this problem with actual WB version?
[12 Jun 2010 12:07] Jeremy Bell
Using 5.2.22 RC2: using an *RSA* key, I still get:

"Error: Could not establish SSH connection: not a valid DSA private key file."

Note that this happens both when trying to create a normal server connection using SSH tunnelling, as well as when using SSH for server administration.

Also note that I have since worked out how generate a *DSA* key file, which allows me to connect successfully. So it's just RSA which is a problem.
[10 Aug 2010 8:45] Susanne Ebrecht
We fixed lots of bugs and I have great hope that this problem finally is fixed in Workbench 5.2.26.

Please try Workbench 5.2.26 and let us know if its fixed.
[10 Aug 2010 9:14] Jeremy Bell
I'm still getting the same message as usual in 5.2.26 unfortunately.

"not a valid DSA private key file"
[10 Aug 2010 12:21] Susanne Ebrecht
Do you other signs in your key then ASCII?
[10 Aug 2010 12:29] Jeremy Bell
No, the characters in the key are made up of:
a-z A-Z 0-9 + = /
[1 Feb 2011 14:27] Valeriy Kravchuk
Please, check if the same problem happens with a newer version, 5.2.31a.
[1 Feb 2011 23:52] Jeremy Bell
This is resolved in 5.2.31a. Thank you.
[2 Feb 2011 8:29] Valeriy Kravchuk
Not repeatable with 5.2.31a.
[2 Jan 2013 21:18] Pal Korossy
I've experienced this issue in Remote management section in version 5.2.44 (OpenSUSE 12.2) please reopen.