Cannot get SFTP with credentials and different port to work

Advertisement

frustrated
Guest

Cannot get SFTP with credentials and different port to work

Hello,

I am running the following command, which has the correct syntax; but it just won't work.

"C:\Program Files (x86)\WinSCP\WinSCP.exe" /command "option batch abort" "option confirm off" "/log=C:\Scripts\Export4MobilePhone\upload-CONT.log" "open sftp://user:pass@host.domain.com:2222/" "put C:\Scripts\Export4MobilePhone\ExportCONT.ldf /synch" "close" "exit"

But WinSCP cannot find the host:

. 2014-02-25 11:26:19.424 --------------------------------------------------------------------------
. 2014-02-25 11:26:19.424 WinSCP Version 5.5.1 (Build 3970) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Standard)
. 2014-02-25 11:26:19.424 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2014-02-25 11:26:19.425 Local account: DOMAIN\user
. 2014-02-25 11:26:19.425 Working directory: C:\Scripts\Export4MobilePhone
. 2014-02-25 11:26:19.425 Process ID: 5516
. 2014-02-25 11:26:19.425 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /command "option batch abort" "option confirm off" "/log=C:\Scripts\Export4MobilePhone\upload-CONT.log" "open sftp://user:pass@host.domain.com:2222/" "put C:\Scripts\Export4MobilePhone\ExportCONT.ldf /synch" "close" "exit"
. 2014-02-25 11:26:19.425 Time zone: Current: GMT-8, Standard: GMT-8, DST: GMT-7, DST Start: 3/9/2014, DST End: 11/2/2014
. 2014-02-25 11:26:19.425 Login time: Tuesday, February 25, 2014 11:26:19 AM
. 2014-02-25 11:26:19.425 --------------------------------------------------------------------------
. 2014-02-25 11:26:19.425 Script: Retrospectivelly logging previous script records:
< 2014-02-25 11:26:19.426 Script: Opening session using command-line parameter in scripting is deprecated. Use 'open' command instead.
. 2014-02-25 11:26:19.426 --------------------------------------------------------------------------
. 2014-02-25 11:26:19.426 Session name: open sftp (Modified site)
. 2014-02-25 11:26:19.426 Host name: open sftp (Port: 22)
. 2014-02-25 11:26:19.426 User name: (Password: No, Key file: No)
. 2014-02-25 11:26:19.426 Tunnel: No
. 2014-02-25 11:26:19.426 Transfer Protocol: SFTP (SCP)
. 2014-02-25 11:26:19.426 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2014-02-25 11:26:19.426 Proxy: none
. 2014-02-25 11:26:19.426 Send buffer: 262144
. 2014-02-25 11:26:19.426 SSH protocol version: 2; Compression: No
. 2014-02-25 11:26:19.426 Bypass authentication: No
. 2014-02-25 11:26:19.426 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2014-02-25 11:26:19.426 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2014-02-25 11:26:19.426 SSH Bugs: A,A,A,A,A,A,A,A,A,A
. 2014-02-25 11:26:19.426 Simple channel: Yes
. 2014-02-25 11:26:19.426 Return code variable: Autodetect; Lookup user groups: A
. 2014-02-25 11:26:19.426 Shell: default
. 2014-02-25 11:26:19.426 EOL: 0, UTF: 2
. 2014-02-25 11:26:19.426 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2014-02-25 11:26:19.426 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2014-02-25 11:26:19.426 SFTP Bugs: A,A
. 2014-02-25 11:26:19.426 SFTP Server: default
. 2014-02-25 11:26:19.426 Local directory: default, Remote directory: //user:pass@host.domain.com:2222/, Update: Yes, Cache: Yes
. 2014-02-25 11:26:19.426 Cache directory changes: Yes, Permanent: Yes
. 2014-02-25 11:26:19.426 DST mode: 1; Timezone offset: 0h 0m
. 2014-02-25 11:26:19.426 --------------------------------------------------------------------------
. 2014-02-25 11:26:19.426 Looking up host "open sftp"





Thank you for any help!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,468
Location:
Prague, Czechia

Re: Cannot get SFTP with credentials and different port to work

You have to put the /log=... parameter before /command or to the end. You cannot insert it in the middle of command list.

Reply with quote

Advertisement

You can post new topics in this forum