Friday, February 15, 2008

Configuring port forwarding in config for ssh

I often run ssh forwarding ports. I also make use of config files quite often for this job.

I often run the following command to do this:
ssh -L 3128:localhost:3128 -l username

However, the syntax in the ssh config file is not quite what you would expect and differs depending on whether its an inbound or outbound forwarding. The following is the config for local forwarding

Host example_proxy
User username
IdentityFile /home/user/.ssh/pwdlogin
Compression yes
CompressionLevel 7
Cipher blowfish
LocalForward 3128 localhost:3128

Notice the awkardly placed spelling. No-one in the man file is this explained. Admittedly its not much of a leap of faith to work out that -L is LocalForward and -R is RemoteForward but seriously this could be in the man file.

No comments: