Topic "Port issues in Script"

Author Message
C Holt

Guest


I am trying to script a SFTP upload to port 10022. Here is the code: open sftp://username:password@someplace.com:port=10022/ -hostkey="ssh-rsa 2048 XX". When I call the script, the session times out; Searching for Host; Network error: Connection to "1.1.1.1" timed out. When I look at the log, the line Connecting to 1.1.1.1 shows port 22 - the script returns to the default. Running this in the GUI interface works like a champ. I have tried to specify the port in the script - but, it is as if the port gets ignored during the connecting. I am using WinSCP version 5.5.6 (Build 4746). Any advice?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24996
Location: Prague, Czechia
Quote:
sftp://username:password@someplace.com:port=10022/

Where did you get this syntax from? (This is real question. I wonder if we need to improve our documentation somehow).

The correct syntax is: sftp://username:password@someplace.com:10022/.
See https://winscp.net/eng/docs/session_url

If you have you session working in GUI, you can use Generate URL function:
https://winscp.net/eng/docs/ui_generateurl
(in the latest release only)
_________________
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