
Я подключаюсь с Windows 7 Pro x64 к своему серверу MySQL, размещенному на Debian Wheezy, с помощью клиента MySQL Workbench, используя «TCP/IP через SSH», но это не работает на моем новом сервере на 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
Итак, главное различие ServerKeyBits
между двумя файлами 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:
Version 6.3.3.0 build 592 (64 bits)
Version 6.0.9.11421 build 1170 (32 bits)
Эти две версии работают с Debian Wheezy, но не с Debian Jessie. Что я упускаю?
решение1
В соответствии сhttps://bugs.mysql.com/bug.php?id=74658проблема возникает при использовании openssh 6.7 библиотек python, поставляемых с MySql Workbench. Хотя добавление "KexAlgorithms" в конфигурацию sshd работает, вы можете обновить библиотеки python, поставляемые с MySql Workbench. Это может быть удобно, если у вас нет контроля над конфигурацией 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, это исправление. [3 июня 2015 г. 15:27] Майк Хадруп Также протестировано на Windows 10 64 бит с MySQL Workbench 6.3.3.0 (592) msi и noinstall против Debian 8 Jessie с OpenSSH 6.7
- скачать zip сhttps://github.com/paramiko/paramikoи распаковать
- скопировать paramiko из paramiko-master в python/site-packages/ (заменить существующий paramiko)
- скачать ecdsa-0.13.tar.gz сhttps://pypi.python.org/pypi/ecdsa#downloadsи распаковать
- скопировать ecdsa из ecdsa-0.13 в python/site-packages/
Вы можете использовать 7zip изhttp://www.7-zip.org/для архива tar ecdsa-0.13.tar.gz gizpped.
Примечание: Распространяемые пакеты Visual C++ для Visual Studio 2013 требуются в Windows 10 из:https://www.microsoft.com/en-us/download/details.aspx?id=40784
На OS X, скопируйте библиотеки paramiko и ecdsa в: /Applications/MySQLWorkbench.app/Contents/Resources/libraries
решение4
В Linux (и ПОЛНОСТЬЮ обойдя эту проблему) я обнаружил, что проще/чище вручную создать собственный туннель ssh для использования mysql-workbench:
ssh root@host -L 3307:localhost:3306
Это создаст SSH-туннель от вашего локального порта 3307 до локального порта 3306 удаленного компьютера.Поэтому вам просто нужно настроить mysql-workbench для подключения к localhost:3307.