I am using this command to port forward in my local machine:

ssh -L 3409: -N -f [email protected]

after run this command, I could connect remote successfully. But when I using another PC in the same local network, it tell me connection refused. This make me confusing, why did this happen? is it possible to using the port 3409 on other computer in the same local network?

  • Note in your code has nothing to do with the listening end. If you did -L then the first would. Frankly I have never thought of using as destination. as destination? -- yes. Jun 11, 2021 at 10:32
  • Please edit your question to show exactly what happens when you try "sing another PC in the same local network". What command are you running, or how did you configure the software that's failing, and how exactly does it fail. Tell us the exact error message.
    – Kenster
    Jun 11, 2021 at 11:31

2 Answers 2


On the machine that is supposed to share the port with other hosts on the LAN, enable Gateway Ports in the /etc/ssh/sshd_conf and restart sshd service.

GatewayPort yes
  • Thanks for sharing! This is really-really useful! Feb 4 at 12:12

Try the following. It should work from your local machine as well as any other machine that can reach your local machine in your network as long as you don't have any firewall on your local machine preventing port 3409.

ssh -L *:3409: -N -f [email protected]

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