Topic "SFTP via SSH tunnel with only WinSCP command line?"

Author Message
andnet81
[View user's profile]

Joined: 2013-09-24
Posts: 3
Location: Germany
Hi,
is it possible to access an SFTP server via an SSH tunnel by using the WinSCP command line tools?

I do not want to use Putty or any other tools to set up the tunnel ahead of time.

WinSCP allows selecting a tunnel in the GUI, but I can not configure it for command line usage.
Tried for hours with ini files and scripts...


Can anyone help?
Advertisements
rac3r5
[View user's profile]

Joined: 2013-09-23
Posts: 4
try this:


Code:
C:\>cd "C:\Program Files (x86)"

C:\Program Files (x86)>cd winscp

C:\Program Files (x86)\WinSCP>winscp
winscp> help
rac3r5
[View user's profile]

Joined: 2013-09-23
Posts: 4
This should help you
Code:

cd "C:\Program Files (x86)"
cd WinSCP
winscp /console /script="C:\temp\myScript.txt"


and myScript.txt should contain.
Code:

open sftp://userName:password@host:port
put licence.txt
close
exit

http://winscp.net/eng/docs/commandline
andnet81
[View user's profile]

Joined: 2013-09-24
Posts: 3
Location: Germany
Guys, seriously. Did you read my posting?

The importand word is "tunnel".
tomb
[View user's profile]

Joined: 2013-07-05
Posts: 19
Did you try the Tunnelxxxx parameters in the -rawsettings option?

http://winscp.net/eng/docs/rawsettings
werewhelk
[View user's profile]

Joined: 2013-11-05
Posts: 1
tomb wrote:
Did you try the Tunnelxxxx parameters in the -rawsettings option?

http://winscp.net/eng/docs/rawsettings


I found this post while trying to do the same thing (non-interactive start of a session through a tunnel).

It almost works, but I'm still getting prompted for the password for the tunnel host.

I tried using TunnelPassword= but this doesn't seem to do anything.
I've tried it both with a cleartext password and also using the encrypted string lifted straight from the INI file.

Does anyone have a solution, or am I just being dumb ?

Edit: I've found the solution. You need to use the "TunnelPasswordPlain=" setting.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
werewhelk wrote:
Edit: I've found the solution. You need to use the "TunnelPasswordPlain=" setting.

I have added this to documentation:
http://winscp.net/eng/docs/rawsettings
_________________
Martin Prikryl
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