Topic "Port Forwarding"

Author Message
MichaelW

Guest


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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
No. WinSCP just forwards single port to remote SSH port. I guess this is of no use for you, isn't it?
_________________
Martin Prikryl
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
datacompboy

Guest


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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
This request has been added to tracker.
_________________
Martin Prikryl
Froeb

Guest


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
diegotolentino
[View user's profile]

Joined: 2008-02-14
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
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.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]
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
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
consistency
[View user's profile]

Joined: 2008-08-16
Posts: 51
Location: austria
+1 for easy portforwarding in winscp
FelipeR

Guest


+1 to port forwarding in WinSCP
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
Raising priority.
_________________
Martin Prikryl
bof
[View user's profile]

Joined: 2014-10-26
Posts: 3
+1
thelr

Guest


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
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
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
Guest




I just wanted to automate the file transfers without opening winscp, through script.
Guest




As per link you mentioned above I need to open winscp to enter the commands.....
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
For an automation, you should start here:
https://winscp.net/eng/docs/guide_automation
Guest




prikryl 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
Why do you want to open PuTTY? You wrote that you want to automate file transfers. PuTTY cannot transfer files.
Guest




prikryl 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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
WinSCP can execute remote commands on its own from the script (with some limitations), using a call command.
https://winscp.net/eng/docs/scriptcommand_call

Code:

open sftp://user@example.com/
put C:\file.txt
call mount -o remount,rw /


Duplicate post on StackOverflow:
http://stackoverflow.com/q/29536486/850848
Guest




prikryl wrote:
WinSCP can execute remote commands on its own from the script (with some limitations), using a call command.
https://winscp.net/eng/docs/scriptcommand_call

Code:

open sftp://user@example.com/
put C:\file.txt
call mount -o remount,rw /


Duplicate post on StackOverflow:
http://stackoverflow.com/q/29536486/850848


Hello Martin,

Thanks ....its helps a lot...
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