Port Forwarding

Advertisement

MichaelW
Guest

Port Forwarding

I often use WinSCP in combination with VNC. While WinSCP is responsible for file transferring I use VNC as remote desktop functionality. Since the server to which I connect is secure the VNC service is also reachable through an ssh tunnel with port forwarding.

So I connect with WinSCP (Connection through Tunnel since the server is not direct reachable) to get the file connection. After that I use two putty sessions (two because putty has no direct tunnel function). The last putty session has port forwarding enabled and forwards the vnc port to a local port to allow the vnc client to connect.

This is a bit complicated, is there a way to set port forwardings directly in WinSCP?

Greetings,
Michael

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,287
Location:
Prague, Czechia

Re: Port Forwarding

No. WinSCP just forwards single port to remote SSH port. I guess this is of no use for you, isn't it?
_________________
Martin Prikryl

Reply with quote

Guest

Hello Martin,

no that's not the intended use in this case. But I also very often use the Putty toolbar button to start putty directly from WinSCP. The advantage of this usage is that Putty starts up already logged in with the authentication data from WinSCP.
In Putty it is possible to specify some port forwarding rules. Maybe it is possible to load a Putty profile with this port forwarding rules when I'm clicking this toolbar symbol.
Is this workaround possible in WinSCP, maybe to give Putty the right command line options?

Greetings,
Michael

Reply with quote

datacompboy
Guest

port forward

Since WinSCP use putty core for SSH, may be add additional port forwardings for connection settings?
So it will also start SCP transfer, and VNC / Xforward ports for testing.
It will be really helpful -- since one empty putty runned only for portforward, when only one connection need.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,287
Location:
Prague, Czechia

Re: port forward

This request has been added to tracker.
_________________
Martin Prikryl

Reply with quote

Advertisement

Froeb
Guest

other SSH Port than 22 for putty also

Hi,

WinSCP can use an other port than 22 for SSH. Good. And it has a very good putty integration. Also very good.

However, when you use another port than 22 for SSH to login via WinSCP and then try to use putty out of WinSCP, you will get an error, because putty tries to use port 22.

So at the moment, I need to open a seperate putty session outside of WinSCP.

I would be very convenient to use the integrated putty also for other ports then 22, in a way that WinSCP (which knows already which port to use, as it has successfully logged in with that port) tells putty which port to use.

Is this possible and can it please be placed on the whishlist?

Thank you
Kai

Reply with quote

diegotolentino
Joined:
Posts:
4

I'm create a Custom commands to solve my problem with port forward the result is like

https://www.bitvise.com/port-forwarding

the script require plink.exe
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

FAQ:
1. Open the winscp.exe
2. Select the "Advanced Options"
3. Go "Preferences > Commands"
4. Click "Add ..."
5. In "Description: " put "Mapear Porta"
5. In "Description: Custom command:"plink -l !U -pw !P -load "WinSCP temporary session" -L !?Endereo Local:?127.0.0.1!:!?Porta Local:?22!:!?Endereo Remoto:?127.0.0.1!:!?Porta Remota:?22!" (without ")
6. Click "Local command"
7. Click "OK"
8. See new button win Tab[/url]

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,287
Location:
Prague, Czechia

Re: other SSH Port than 22 for putty also

Froeb wrote:

I would be very convenient to use the integrated putty also for other ports then 22, in a way that WinSCP (which knows already which port to use, as it has successfully logged in with that port) tells putty which port to use.
It works for me. What version of WinSCP are you using? Any chance that you have stored session in PuTTY with the same name as WinSCP session?
_________________
Martin Prikryl

Reply with quote

Advertisement

thelr
Guest

Feature request vote

It would be great to be able to configure port forwarding with WinSCP sessions rather than keeping a separate folder of batch files to start plink tunnels. +1

Reply with quote

Advertisement

Guest

Hi Martin,
Can you suggest me to open putty session through winscp commands,
My requirement is to pass the putty command like mount -o remount,rw / without opening putty manually.
All these things to be done with winscp command/settings/configuration

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,287
Location:
Prague, Czechia

Anonymous wrote:

Can you suggest me to open putty session through winscp commands,
My requirement is to pass the putty command like mount -o remount,rw / without opening putty manually.
All these things to be done with winscp command/settings/configuration
Why don't you use WinSCP console?
https://winscp.net/eng/docs/ui_console

Reply with quote

Advertisement

Guest

HI Martin,

As per link you mentioned above I need to open winscp to enter the commands.....
I just wanted to automate the file transfers without opening winscp, through script.
upto some extent I performed the file transfer operation except putty session.

Regards,
Raj

Reply with quote

Guest

martin wrote:

For an automation, you should start here:
https://winscp.net/eng/docs/guide_automation

Hi Martin,

Yes I prepared the script file like this.
sftprun.cmd > Script file name.

D:\winscp\winscp.com /script=D:\winscp_auto\sftpscriptJAC.txt > content of the script.

can you please suggest me to open putty through above mentioned script.

the putty details should be provided under the script file "sftpscriptJAC"

Thanks,
Raj

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,287
Location:
Prague, Czechia

Why do you want to open PuTTY? You wrote that you want to automate file transfers. PuTTY cannot transfer files.

Reply with quote

Advertisement

Guest

martin wrote:

Why do you want to open PuTTY? You wrote that you want to automate file transfers. PuTTY cannot transfer files.

Hi Martin,
Yes, PuTTy cannot transfer files, but if you want to delete/rename/move files of remote machine then we need to give the read and write permissions for those.(permissions in the sense it is different from 0777)

Normally we used to open puTTy session manually and then we pass this command
"mount -o remount,rw /"

Else is there any other way to perform these actions, please suggest.....

Thanks,
Rajendra.

Reply with quote

Advertisement

You can post new topics in this forum