On Mon, 19 Oct 2009, Adriana Rodean wrote: > I always do a remote port forwarding with openssh on 1026 port let's > say ( ssh -R 1026:localhost:55555 ). Most times the port is opened on > remote machine. But sometimes i notice that ssh can't do remote port > forwarding to that port 1026. I looked on the remote machine (netstat > -an) and no one is using that port, so the port is free. > Only way to fix this is do a remote port forwarding to another port > lets say 1056, successfully done, then try again and do it for 1026, > this time remote port forwarding successfully works... Sometimes it > works if i try again with 1026, but other times i need to open another > port then try again with 1026 port... > > [..] > > I use version of OpenSSH 5.1p1 on remote machine and the client is > OpenSSH for Windows 3.8.1p1 Nobody uses the port, but it is still in TIME_WAIT state. Usually openssh uses SO_REUSEADDR to say the kernel that the port can be reused while in TIME_WAIT state, but to avoid X11 man-in-the-middle attack the portable version of OpenSSH 5.1 does not set it if you have X11UseLocalhost=no. So, you should either wait a little after each closing of the port before trying to use it again, or set X11UseLocalhost=yes. -- Regards, ASK