Debian Jessie を使用した MySQL Workbench - SSH 経由の TCP/IP が機能しない

Debian Jessie を使用した MySQL Workbench - SSH 経由の TCP/IP が機能しない

以前は、MySQL Workbench クライアントを使用して「TCP/IP over SSH」を使用して、Debian Wheezy でホストされている MySQL サーバーに Windows 7 Pro x64 で接続していましたが、Debian Jessie の新しいサーバーでは動作しません。なぜでしょうか。


MySQL Workbench の設定:

Connection Name: TEST
Connection Method: Standard TCP/IP over SSH

SSH Hostname: x.x.x.x:22
SSH Username: root
SSH Password: myRootPa$$word
SSH Key File: <NOT-USING-KEYFILE>

MySQL Hostname: 127.0.0.1
MySQL Server Port: 3306
Username: root
Password: myMySQLPa$$word

IP アドレス/ホスト名、ユーザー名、パスワードを再確認しました...


Debian Wheezy サーバー設定:

root@debian:~# cat /etc/debian_version

7.8

mysql> バージョンを選択します();

+------------------+
| version()        |
+------------------+
| 5.5.40-0+wheezy1 |
+------------------+
1 row in set (0.00 sec)

root@debian:~# cat /etc/ssh/sshd_config

Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
UsePrivilegeSeparation yes

KeyRegenerationInterval 3600
ServerKeyBits 768
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes

IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes

AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes

Debian Jessie サーバー設定:

root@debian:~# cat /etc/debian_version

8.0

mysql> バージョンを選択します();

+-----------------+
| version()       |
+-----------------+
| 5.5.43-0+deb8u1 |
+-----------------+
1 row in set (0.00 sec)

root@debian:~# cat /etc/ssh/sshd_config

Port 22
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes

KeyRegenerationInterval 3600
ServerKeyBits 1024
SyslogFacility AUTH
LogLevel INFO
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
RSAAuthentication yes
PubkeyAuthentication yes

IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PermitEmptyPasswords no
ChallengeResponseAuthentication no

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes

AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
UsePAM yes

つまり、主な違いはServerKeyBits2 つの sshd_config ファイル間にあります...


MySQL Workbench 6.3.3に接続しようとするとエラーが発生します。デビアンジェシーサーバ:

Could not connect the SSH Tunnel
Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details

ログファイル:

10:00:04 [INF][     SSH tunnel]: Starting tunnel
10:00:04 [INF][     SSH tunnel]: Existing SSH tunnel not found, opening new one
10:00:07 [INF][     SSH tunnel]: Opening SSH tunnel to 10.232.50.15:22
10:00:07 [WRN][sshtunnel.py:_connect_ssh:287]: IOError, probably caused by file C:\Users\myUser\AppData\Roaming\MySQL\Workbench\ssh\known_hosts not found, the message was: [Errno 2] No such file or directory: u'C:\\Users\\myUser\\AppData\\Roaming\\MySQL\\Workbench\\ssh\\known_hosts'
10:00:07 [ERR][sshtunnel.py:notify_exception_error:233]: Traceback (most recent call last):
  File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE\sshtunnel.py", line 297, in _connect_ssh
    look_for_keys=has_key, allow_agent=has_key)
  File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\paramiko\client.py", line 301, in connect
    t.start_client()
  File "C:\Program Files\MySQL\MySQL Workbench 6.3 CE/python/site-packages\paramiko\transport.py", line 461, in start_client
    raise e
SSHException: Incompatible ssh peer (no acceptable kex algorithm)

10:00:07 [INF][     SSH tunnel]: TunnelManager.wait_connection authentication error: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details
10:00:07 [ERR][     SSH tunnel]: Authentication error opening SSH tunnel: Authentication error, unhandled exception caught in tunnel manager, please refer to logs for details

詳細情報:

フォルダ「ssh」が存在しません:

C:\Users\myUser\AppData\Roaming\MySQL\Workbench

両方のサーバーのファイアウォール ルール:

root@debian:~# iptables -vnL

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

どちらのサーバーでもSSH(KiTTY)で接続できます...


私は MySQL Workbench の 2 つの異なるバージョンを試しました:

Version 6.3.3.0 build 592 (64 bits)
Version 6.0.9.11421 build 1170 (32 bits)

これら 2 つのバージョンは Debian Wheezy では動作しますが、Debian Jessie では動作しません。 何が足りないのでしょうか?

答え1

によると参考:この問題は、MySql Workbench に同梱されている Python ライブラリである openssh 6.7 を使用するときに発生します。sshd 構成に「KexAlgorithms」を追加すると機能しますが、MySql Workbench に同梱されている Python ライブラリを更新できます。sshd 構成を制御できない場合は、これが便利かもしれません...

バグレポートを下にスクロールすると、paramiko および ecdsa ライブラリをダウンロードしてコピーする手順があります。

答え2

解決策を見つけました。

ファイルに次の行を追加しました/etc/ssh/sshd_config:

KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

sshを再起動しました: systemctl restart ssh

この投稿で示唆されているように: https://stackoverflow.com/questions/26577494/aptana-sftp-key-exchange

答え3

bigmandan の回答はスクロールする部分が多いので、見つけやすくするためにここにも投稿したほうがよいと思います。

Windowsの場合これが修正です。[2015年6月3日 15:27] Mike Hadrup また、Windows 10 64ビット版でMySQL Workbench 6.3.3.0 (592) msiおよびnoinstallを使用して、Debian 8 JessieとOpenSSH 6.7でテストしました。

7zipは以下からご利用いただけますhttp://www.7-zip.org/ecdsa-0.13.tar.gz gizpped tar アーカイブ用。

注: Windows 10 では、次の場所から Visual Studio 2013 用の Visual C++ 再頒布可能パッケージが必要です。https://www.microsoft.com/en-us/download/details.aspx?id=40784

OS Xの場合paramiko および ecdsa ライブラリを /Applications/MySQLWorkbench.app/Contents/Resources/libraries にコピーします。

答え4

Linux では (そして問題を完全に回避して)、mysql-workbench が使用する独自の ssh トンネルを手動で作成する方が簡単かつクリーンであることがわかりました。

ssh ルート@ホスト -L 3307:localhost:3306

これにより、ローカル ポート 3307 からリモートのローカル ポート 3306 への SSH トンネルが作成されます。つまり、mysql-workbenchをlocalhost:3307に接続するように設定するだけで済みます。

関連情報