
저는 "TCP/IP over SSH"를 사용하여 MySQL Workbench 클라이언트를 사용하여 Debian Wheezy에 호스팅된 MySQL 서버에 Windows 7 Pro x64를 연결했지만 Debian Jessie의 새 서버에서는 작동하지 않습니다. 이유는 무엇입니까?
MySQL 워크벤치 구성:
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:~# 고양이 /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:~# 고양이 /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이 문제는 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의 답변에는 스크롤할 내용이 많기 때문에 쉽게 찾을 수 있도록 여기에 게시하는 것이 합리적일 수 있다고 생각합니다.
윈도우의 경우, 이것이 수정되었습니다. [2015년 6월 3일 15:27] Mike Hadrup 또한 MySQL Workbench 6.3.3.0 (592) msi를 사용하여 Windows 10 64비트에서 테스트했으며 OpenSSH 6.7을 사용하여 Debian 8 Jessie에 대해 noinstall을 테스트했습니다.
- 에서 zip 다운로드https://github.com/paramiko/paramiko그리고 압축을 푼다
- paramiko-master에서 python/site-packages/로 paramiko를 복사합니다(기존 paramiko 교체).
- 에서 ecdsa-0.13.tar.gz를 다운로드하세요.https://pypi.python.org/pypi/ecdsa#downloads그리고 압축을 푼다
- ecdsa-0.13에서 python/site-packages/로 ecdsa를 복사합니다.
다음에서 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에 연결하기만 하면 됩니다..