Specify outbound port with ssh?
Posted on 2009-07-14
I am ssh'ing to a remote server, which is listening on the standard port 22, using a no-frills "ssh firstname.lastname@example.org" command to connect.
I would like to specify the outbound port my system uses to connect. By default it gets a normal system-assigned port like 55129, etc. Is there a way to tell ssh to use a specific outbound port?
Reading the man pages and googling, I found the -R and -L options for forwarding, which are useful for tunnelling. I can specify my bind address with "-b <address>" and the remote port to connect to with "-p <port>".
But I can't see where to specify the outgoing port I want ssh to use. I want to do this so I specify on the remote system to only allow incoming connections from specific ports on the clients.
Is this possible?