So I typically run this command a lot:
ssh -L 5901:[email protected]:5901
I use it to do VNC over SSH.
How do I convert that command into something that will work in a ~/.ssh/config file?
ex:
host yam
HostName yam.myHost.edu
User myUserName
all I want to do is type:
ssh yam
And have it open a SSH shell with a local listen port, and a remote port forwarded to it.
Suggestions?
You can use the LocalForward
directive in your host yam
section of ~/.ssh/config
:
LocalForward 5901 computer.myHost.edu:5901