Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

vlad.bel

Thank you, Martin.
martin

Re: Same problem

"C:\Program Files\WinSCP\WinSCP.com" /command "open sftp://username:password@mysite.com:3879/ -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" "put C:\Cache\Qty-UL.php /public_html/vb-scripts/" "exit"

See https://winscp.net/eng/docs/commandline#syntax
vlad.bel

Re: Same problem

martin wrote:

vlad.bel wrote:

Normally, in GUI, connection works both in FTP and SFTP sessions. When I use same session name in command line, I see exactly same log as in this topic above.
Is there the way to specify port # in command line?

If you want to use the FTP protocol, use ftp:// protocol prefix in the session URL:
https://winscp.net/eng/docs/session_url

You can specify the port in the URL explicitly too. But it's not necessary, if you use the standard port for the protocol (i.e. 21 for FTP).


I have it done for ftp in command line but i need it to work with sftp. My sftp connection works fine in WinSCP GUI not in command line. I have leraned examples and collected command line which does not work (in cmd.exe):
>"C:\Program Files\WinSCP\WinSCP.com" /command "open sftp://username:password@mysite.com:3879/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"" "put C:\Cache\Qty-UL.php /public_html/vb-scripts/" "exit"

The story is:

Searching for host...
Connecting to host...
Authenticating...
Host key does not match configured key "ssh-rsa"!
Host key fingerprint is ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Authentication failed.
Unknown command '2048'.
Unknown command 'xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx'.
No session.

So it does not accept white spaces in host key. I do not know what to do about it. W/o host key specified, program wanted to get "Yes" in order to finish authentication as if I could do it.
Please advise. Thanks for your time.
martin

Re: Same problem

vlad.bel wrote:

Normally, in GUI, connection works both in FTP and SFTP sessions. When I use same session name in command line, I see exactly same log as in this topic above.
Is there the way to specify port # in command line?

If you want to use the FTP protocol, use ftp:// protocol prefix in the session URL:
https://winscp.net/eng/docs/session_url

You can specify the port in the URL explicitly too. But it's not necessary, if you use the standard port for the protocol (i.e. 21 for FTP).
vlad.bel

Re: Same problem

Normally, in GUI, connection works both in FTP and SFTP sessions. When I use same session name in command line, I see exactly same log as in this topic above.
Is there the way to specify port # in command line?
vlad.bel

Same problem

I experience this problem too. In my session settings there port is 21 but when the command line is used, we can see in the log that port 22 is submitted. Why is that?
martin

Re: Knocking FTP port, Port did not open

Did you check server-side log if it received an incoming connection?
cyanceenu

Knocking FTP port, Port did not open

Hi

I'm executing the winscp.com with script file from the Windows Scheduler, the job is scheduled for every 10 mins. Sometimes the connection is successful and sometime not successful, I'm herewith attaching the log file can some one look into the issue.

. 2015-07-29 10:40:01.947 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2015-07-29 10:40:01.947 SFTP Bugs: A,A
. 2015-07-29 10:40:01.947 SFTP Server: default
. 2015-07-29 10:40:01.947 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2015-07-29 10:40:01.947 Cache directory changes: Yes, Permanent: Yes
. 2015-07-29 10:40:01.947 DST mode: 1
. 2015-07-29 10:40:01.947 --------------------------------------------------------------------------
. 2015-07-29 10:40:01.947 Looking up host "211.25.235.209"
. 2015-07-29 10:40:01.947 Connecting to 211.25.235.209 port 22
. 2015-07-29 10:40:22.968 Failed to connect to 211.25.235.209: Network error: Connection timed out
. 2015-07-29 10:40:22.968 Knocking FTP port.
. 2015-07-29 10:40:24.968 FTP port did not open.
. 2015-07-29 10:50:03.832 -----------------------

Thanks & Regards
Srinivas