title: Connect to SQL Server 2016 via Putty/SSH
body: <p>I have an SSH tunnel established to my Server using Putty. I have set up two tunnels:</p>
  
  <pre><code>L3407 =&gt; 192.168.100.107:3389
  L31433 =&gt; 192.168.100.107:1433
  </code></pre>
  
  <p>I can successfully RDP into the server using "localhost:3407".  However, when I open SSMS and try using "localhost,31433" it won't connect.  The error I get reads:</p>
  
  <p>"A network-realted or instance-speciffic error occured while establishing a connection to SQL Server. The server was not found or was not accessible. Verify the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The remote computer refused the network connection.) (Microsoft SQL Server, Error: 1225)"</p>
  
  <p>I've verified that TCP/IP is turned on in SQL Server Configuration Manager, and the IP addresses are setup.  I have checked the logs on the SQL Server, and I have:</p>
  
  <pre><code>- Server is listening on [127.0.0.1 &lt;ipv4&gt; 1434]
  - Server is listening on [::1 &lt;ipv6&gt; 1434]
  - Server is listening on ['any' &lt;ipv4&gt; 1433]
  - Server is listening on ['any' &lt;ipv6&gt; 1433]
  </code></pre>
  
  <p>I can connect to SSMS on the server using the machine name (named pipes),(LOCAL), localhost, 192.168.100.107, or the public IP.  And if I open a hole in the Firewall for port 1433, then I can connect locally using ":1433".  (Of course I almost immediately start seeing hacking attempts, so it has to be turned right back off.)</p>
  
  <p>Based on the error I would think that the server is blocking it somehow, but the local Firewall is off and the hardware Firewall logs no attempts for RDP or SSMS (as expected, since it is going through the tunnel).</p>
  
  <p>I am lost on what else to try. Anyone have any ideas?</p>