Problem
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?
ex:
host yam
HostName yam.myHost.edu
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.
Suggestions?
Asked by Snow_Mac
Solution #1
In your host yam section of /.ssh/config, you can utilize the LocalForward directive:
LocalForward 5901 computer.myHost.edu:5901
Answered by Johnsyweb
Post is based on https://stackoverflow.com/questions/9146457/ssh-port-forwarding-in-a-ssh-config-file