Workbench Could not connect the SSH Tunnel Authentication error

1. 问题现象

平日正常使用的 Workbench 在重启电脑之后发现无法连接到对应的数据库,workbench log显示

SSH tunnel]: Authentication error opening SSH tunnel: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details

查阅完整 log 发现如下内容:

$ tail -f ~/.mysql/workbench/log/wb.log 
  File "/usr/share/mysql-workbench/sshtunnel.py", line 303, in _connect_ssh
    look_for_keys=has_key, allow_agent=has_key, timeout=SSH_CONNECTION_TIMEOUT)
  File "/usr/lib/python2.7/dist-packages/paramiko/client.py", line 325, in connect
    t.start_client()
  File "/usr/lib/python2.7/dist-packages/paramiko/transport.py", line 492, in start_client
    raise e
NotImplementedError: Use module Crypto.Signature.pkcs1_15 instead

14:17:14 [INF][     SSH tunnel]: TunnelManager.wait_connection authentication error: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details
14:17:14 [ERR][     SSH tunnel]: Authentication error opening SSH tunnel: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details
14:18:24 [INF][      WBContext]: Connection to XinJangCityWolMart cancelled by user: Tunnel connection cancelled

重点是

NotImplementedError: Use module Crypto.Signature.pkcs1_15 instead

使用 pip list 查询后发现

$ pip2 list | grep crypto
asn1crypto (1.4.0)
cryptography (2.7)
pycrypto (2.6.1)
pycryptodome (3.11.0)

有个 pycryptodome 东东,可能是后面安装其它工具的时候附带安装上的。

2. 解决方法

卸载 pycryptodome

sudo pip2 uninstall pycryptodome

然后重新打开 Workbench 连接数据库恢复正常。


版权声明:本文为wohu1104原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。