SSH Port forwarding in a ~/.ssh/config file? [closed]

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?

1 Answer
1

Leave a Comment