I wanted to forward my local 8080 port to the 80 port of the server I want to log in via SSH, so I did:

ssh -L 80: -N -f myserver

But I get the error:

Privileged ports can only be forwarded by root.

I can execute sudo commands when logged in that server, but how can I do it for the purposes of port forwarding? (Note: appending sudo at the beginning of this command doesn't help, because the port 80 is not the port I want to use in localhost, but the port I want to target.)

1 Answer 1


You probably want

ssh -L 8080: -N -f myserver

Local port comes first. (That's not my political stance!)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .