Topic "is it possible to choose the source port?"

Author Message
zskillz

Guest


version 3.76
SFTP/SCP
norton commander

Hi Martin,
Thanks in advance for a great product! I use it all the time now and it's fantastic. I appreciate all of the work you put into making the synchronizing capabilities very strong. It has really simplified my life.

Now onto the question. I have a situation that I'm not sure how to get around... In order to gain access to Computer B, I have to ssh tunnel through computer A (it's a security measure that i have no control over). I'd like to be able to use winSCP to graphically interact with computer B. The only way that I can think of to do this would be to forward the source port winSCP is using through computer A (using the -L xxxx:com.put.erB.IP:22 command). Unfortunately, it appears as if winSCP chooses a random port in the high 3000 range, so I can't use the (-L) approach unless i know the source port first. Would it be possible to integrate an option into the parameters that allows one to choose the source port #?

Alternatively, if you can think of a simpler way to do what I'm interested in, I'm definitely up for the suggestions!

thanks,
-Z
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
Isn't it that you specify remote (server-side) listen port to -L switch instead of local (client-side) source port?
_________________
Martin Prikryl
zskillz

Guest


-L port:host:hostport
Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. This works by allocating a socket to be listened port on the local side, and whenever a connection is made to this port, the connection is forwarded over the secure channel and a connection is made to host:hostport from the remote machine. Port forwardings can also be specified in the configuration file. Only root can forward privileged ports.

manpage of ssh2 = <invalid hyperlink removed by admin>

you may be thinking of the -R switch, but in either case, (unless I'm misunderstanding you) I don't have any control over the remote port at all b/c it's an ssh daemon. The approach I'm taking here is similar to tunneling VNC through ssh for a secure connection. I know this is a little more unconventional, but I don't see a reason why it shouldn't work just the same in theory.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
zskillz wrote:
-L port:host:hostport
Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. This works by allocating a socket to be listened port on the local side, and whenever a connection is made to this port, the connection is forwarded over the secure channel and a connection is made to host:hostport from the remote machine. Port forwardings can also be specified in the configuration file. Only root can forward privileged ports.

Sorry, I may miss something Smile
If I understand the SSH tunneling, you run some application (like ssh from OpenSSH) that starts listening on certain port and whatever comes there is forwarded to remote port. The only thing the WinSCP needs to do, is to connect to the listening port. That's all. Isn't it?
_________________
Martin Prikryl
zskillz

Guest


prikryl wrote:

Sorry, I may miss something Smile
If I understand the SSH tunneling, you run some application (like ssh from OpenSSH) that starts listening on certain port and whatever comes there is forwarded to remote port. The only thing the WinSCP needs to do, is to connect to the listening port. That's all. Isn't it?


Sorry! You didn't miss anything - I was thinking about it incorrectly! Everything works perfectly now! Rolling Eyes Laughing Laughing I'm not sure what the hell I was thinking about!!!

thanks again Martin, keep up the good work!
-Z
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License