Ssh – Putty: Local port 80 forwarding to localhost:80 failed: Network error: Permission denied

puttysshssh-tunnelwindows 10

In putty, I have the following:

  • Session
    • hostname:username@azurecontainsersvc_mgmt.eastus.cloudapp.azure.com
    • port: 2200
  • Connection>SSH>Tunnels L80 localhost:80
  • Connection>SSH>Auth Private key: my_public_key.ppk

Ans when I connect, it asks me for my password, everything looks great, but I get access denied. I have tried running as admin with the same results.

2017-05-02 11:28:37 Connecting to [IP_Address] port 2200

2017-05-02 11:28:37 We claim version: SSH-2.0-PuTTY_Release_0.69

2017-05-02 11:28:37 Server version: SSH-2.0-OpenSSH_7.2p2
Ubuntu-4ubuntu2.1

2017-05-02 11:28:37 Using SSH protocol version 2

2017-05-02 11:28:37 Doing ECDH key exchange with curve Curve25519 and
hash SHA-256

2017-05-02 11:28:37 Server also has ecdsa-sha2-nistp256/ssh-rsa host
keys, but we don't know any of them

2017-05-02 11:28:37 Host key fingerprint is:

2017-05-02 11:28:37 ssh-ed25519 256 [Fingerprint]

2017-05-02 11:28:37 Initialised AES-256 SDCTR client->server
encryption

2017-05-02 11:28:37 Initialised HMAC-SHA-256 client->server MAC
algorithm

2017-05-02 11:28:37 Initialised AES-256 SDCTR server->client
encryption

2017-05-02 11:28:37 Initialised HMAC-SHA-256 server->client MAC
algorithm

2017-05-02 11:28:37 Reading key file "C:\path_to_certs\privatekey.ppk"

2017-05-02 11:28:37 Offered public key

2017-05-02 11:28:37 Offer of public key accepted

2017-05-02 11:28:55 Sent public key signature

2017-05-02 11:28:55 Access granted

2017-05-02 11:28:55 Opening session as main channel

2017-05-02 11:28:56 Opened main channel

2017-05-02 11:28:56 Local port 80 forwarding to localhost:80 failed:
Network error: Permission denied

2017-05-02 11:28:56 Allocated pty (ospeed 38400bps, ispeed 38400bps)

2017-05-02 11:28:56 Started a shell/command

Any ideas? I am lost – thank you!

Not sure if it matters, but I am trying to connect to a DC/OS cluster on Azure: https://docs.microsoft.com/en-us/azure/container-service/container-service-connect

Best Answer

That problems can have different origins:

  1. tcp port 80 is already in use by another program. Check if you have a local web server running.
  2. You don't have sufficient privileges to open port 80. Listening to ports under 1024 needs administrator privileges.
  3. port forwarding is not permitted on the server side (AllowTcpForwarding no in sshd_config). If you can't change sshd_config on the server, then it just won't be possible to forward ports.