from the wiki refusing port

I've setup a custom port in my sshd_config, and when I followed the guide in the Library for a mysql-tunnel and started the script, I got a connection refused on port 22, whereas I've changed my port to something else. Can someone give me some direction on fixing this please?

2 Replies


I've setup a custom port in my sshdconfig You should not have to modify the sshdconfig on the server where mysql is running. The purpose of the 'Securely Administer MySQL with an SSH Tunnel' library is to securely access mysql on the local interface of the server, so myslq is not accessible on a public IP.

Maybe posting your sshd_config would help us in identifying the problem.


mysql-tunnel is ultimately running this:

ssh -f -L $local_ip:$local_port:$remote_ip:$remote_port $remote_user\@$remote_host -N

but you want it to run something like this:

ssh -p NONSTANDARD_PORT -f -L $local_ip:$local_port:$remote_ip:$remote_port $remote_user\@$remote_host -N

I would simply edit the script, but maybe there's also a way to set the -p option with ~/.ssh/config or an environment variable.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct