Bug #93149 MySQL Workbench Remote Administration always uses port 22
Submitted: 10 Nov 2018 11:32 Modified: 12 Nov 2018 9:13
Reporter: Brendan Taylor Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Workbench: Administration Severity:S3 (Non-critical)
Version:8.0.13 OS:Microsoft Windows (Microsoft Windows 10 Enterprise)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[10 Nov 2018 11:32] Brendan Taylor
When using remote administaion via ssh, it appears that even when a non-default port is used e.g 2222 workbench still uses the default ssh port 22.

How to repeat:
Change SSH listening port to 2222
Setup remote administation in workbench and attempt to connect with the correct details.
Connection via ssh fails.
Check logs and see workbench is using port 22 still.
[12 Nov 2018 9:13] Umesh Shastry
Hello Brendan,

Thank you for the report.
I tried to reproduce this issue and confirmed that MySQL Workbench 8.0.13, connected to MySQL Server hosted on Ubuntu 18.04(sshd listening on non-default port i.e 2222) using connection method TCP/IP over SSH - no issues observed i.e using 2222 sshd port.

## Ubuntu 18.0.04, sshd port 2222
ushastry@BionicBeaver:~$  sudo netstat -tpln | egrep '(Proto|ssh)'
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0  *               LISTEN      2429/sshd           
tcp6       0      0 :::2222                 :::*                    LISTEN      2429/sshd           

## WB log confirming no issues - WB from Win7, MySQL server running on Ubuntu 18.0.04, sshd port 2222

14:25:14 [INF][     SSH tunnel]: Opening SSH tunnel to xx.xxx.xxx.xxx:2222
14:25:14 [DB2][      SSHCommon]: SSH Connection config info:
14:25:14 [DB2][      SSHCommon]: SSH bufferSize: 500
14:25:14 [DB2][      SSHCommon]: SSH connectTimeout: 10
14:25:14 [DB2][      SSHCommon]: SSH readWriteTimeout: 5
14:25:14 [DB2][      SSHCommon]: SSH commandTimeout: 1
14:25:14 [DB2][      SSHCommon]: SSH commandRetryCount: 3
14:25:14 [DB2][      SSHCommon]: SSH optionsDir: 
14:25:14 [DB2][      SSHCommon]: SSH known hosts file: 
14:25:14 [DB2][      SSHCommon]: SSH local host:
14:25:14 [DB2][      SSHCommon]: SSH local port: 0
14:25:14 [DB2][      SSHCommon]: SSH remote host:
14:25:14 [DB2][      SSHCommon]: SSH remote port: 3306
14:25:14 [DB2][      SSHCommon]: SSH remote ssh host: xx.xxx.xxx.xxx
14:25:14 [DB2][      SSHCommon]: SSH remote ssh port: 2222
14:25:14 [DB2][      SSHCommon]: SSH strict host key check: yes
14:25:14 [INF][      SSHCommon]: libssh: ssh_connect ssh_connect: libssh 0.7.5 (c) 2003-2014 Aris Adamantiadis, Andreas Schneider, and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_stdthread
14:25:14 [DB3][      SSHCommon]: libssh: getai getai: host xx.xxx.xxx.xxx matches an IP address
14:25:16 [DB3][      SSHCommon]: libssh: ssh_packet_userauth_success ssh_packet_userauth_success: Received SSH_USERAUTH_SUCCESS
14:25:16 [DB3][SSHTunnelManager]: About to create ssh tunnel.
14:25:16 [DB2][SSHTunnelManager]: Tunnel port created on socket: 52276
14:25:16 [DB3][SSHTunnelHandler]: Start tunnel handler thread.
14:25:16 [INF][     SSH tunnel]: SSH tunnel opened on port: 52276
14:25:16 [DB2][     SSH tunnel]: Increment port usage count: 52276
14:25:16 [DB3][SQL Editor Form]: Creating KeepAliveInterval timer...
14:25:16 [DB1][ mforms managed]: Looking up password for service: Mysql@, account: root
14:25:16 [DB1][ mforms managed]: Loading password cache
14:25:16 [DB1][ mforms managed]: Get special folder
14:25:16 [DB2][ mforms managed]: Decrypting password data
14:25:16 [DB2][ mforms managed]: Filling password cache
14:25:16 [DB1][ mforms managed]: Unloading password cache
14:25:16 [DB1][ mforms backend]: Looking up password for 'root'@'Mysql@' has failed
14:25:16 [DB3][    WQE backend]: Connecting SQL editor...
14:25:16 [DB1][ mforms managed]: Running a cancelable wait message
14:25:16 [DB3][       GRT task]: Sending task "execute sql queries" to dispatcher (wait)...
14:25:16 [DB1][  GRTDispatcher]: starting worker thread
14:25:16 [DB1][  GRTDispatcher]: worker thread running
14:25:16 [DB3][  GRTDispatcher]: Running task "execute sql queries"
14:25:16 [DB3][SSHTunnelHandler]: About to handle new connection.
14:25:16 [DB3][SSHTunnelHandler]: Accepted new connection.
14:25:17 [DB3][SSHTunnelHandler]: Unable to open channel, wait a moment and retry.
14:25:18 [DB1][SSHTunnelHandler]: Channel successfully opened
14:25:18 [DB1][SSHTunnelHandler]: Tunnel created.
14:25:20 [DB2][SQL Editor Form]: Notifying server state change of Mysql@ to running
14:25:21 [DB3][SSHTunnelHandler]: About to handle new connection.
14:25:21 [DB3][SSHTunnelHandler]: Accepted new connection.
14:25:21 [DB3][SSHTunnelHandler]: Unable to open channel, wait a moment and retry.
14:25:22 [DB1][SSHTunnelHandler]: Channel successfully opened
14:25:22 [DB1][SSHTunnelHandler]: Tunnel created.
14:25:26 [INF][SQL Editor Form]: Opened connection 'xx.xxx.xxx.xxx_2222' to MySQL Community Server - GPL version 8.0.12

[12 Nov 2018 9:13] Umesh Shastry

Attachment: 93149_win7.png (image/png, text), 52.99 KiB.