Coder Perfect

/.ssh/config file SSH port forwarding? [closed]


As a result, I frequently use the following command:

It’s what I use to run VNC via SSH.

What’s the best way to turn that command into something that will operate in a /.ssh/config file?


host yam
    User myUserName

The only thing I want to do is type:

ssh yam

Open an SSH shell with a local listen port forwarded to it, as well as a remote port forwarded to it.


Asked by Snow_Mac

Solution #1

In your host yam section of /.ssh/config, you can utilize the LocalForward directive:

LocalForward 5901

Answered by Johnsyweb

Post is based on