Re: Sorry about that
Am I mistaken on what the hostkey does?
Most likely.
Host key is server's key.
You are probably looking for a client key:
https://winscp.net/eng/docs/public_key
Am I mistaken on what the hostkey does?
As you can see in the log, the host key is verified correctly, so it has nothing to do with host key.
You are prompted for password because you do not provide any in your script.
WinSCP.exe /console /command "option batch abort" "open sftp://user@domain.com/ -hostkey=""ssh-rsa 1024 KEY""" "cd htdocs" "get dearCalvin.php DearCalvin.php" "exit"
. 2014-03-05 16:00:17.156 --------------------------------------------------------------------------
. 2014-03-05 16:00:17.157 WinSCP Version 5.5.1 (Build 3970) (OS 6.1.7601 Service Pack 1 - Windows 7 Professional)
. 2014-03-05 16:00:17.157 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2014-03-05 16:00:17.157 Local account: domain\user
. 2014-03-05 16:00:17.157 Working directory: C:\Users\Me\Desktop
. 2014-03-05 16:00:17.157 Process ID: 11136
. 2014-03-05 16:00:17.157 Command-line: WinSCP.exe /console /command "option batch abort" "open sftp://user@doain.com/ -hostkey=""ssh-rsa 1024 KEY""" "cd htdocs" "get dearCalvin.php DearCalvin.php" "exit"
. 2014-03-05 16:00:17.157 Time zone: Current: GMT-6, Standard: GMT-6, DST: GMT-5, DST Start: 3/9/2014, DST End: 11/2/2014
. 2014-03-05 16:00:17.157 Login time: Wednesday, March 05, 2014 4:00:17 PM
. 2014-03-05 16:00:17.157 --------------------------------------------------------------------------
. 2014-03-05 16:00:17.157 Script: Retrospectivelly logging previous script records:
> 2014-03-05 16:00:17.157 Script: option batch abort
< 2014-03-05 16:00:17.157 Script: batch abort
> 2014-03-05 16:00:17.157 Script: open sftp://user@domain.com/ -hostkey="ssh-rsa 1024 KEY"
. 2014-03-05 16:00:17.157 --------------------------------------------------------------------------
. 2014-03-05 16:00:17.157 Session name: user@domain.com (Modified site)
. 2014-03-05 16:00:17.157 Host name: domain.com (Port: 22)
. 2014-03-05 16:00:17.157 User name: username (Password: No, Key file: No)
. 2014-03-05 16:00:17.157 Tunnel: No
. 2014-03-05 16:00:17.157 Transfer Protocol: SFTP
. 2014-03-05 16:00:17.157 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2014-03-05 16:00:17.157 Proxy: none
. 2014-03-05 16:00:17.157 Send buffer: 262144
. 2014-03-05 16:00:17.157 SSH protocol version: 2; Compression: No
. 2014-03-05 16:00:17.157 Bypass authentication: No
. 2014-03-05 16:00:17.157 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2014-03-05 16:00:17.157 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2014-03-05 16:00:17.157 SSH Bugs: A,A,A,A,A,A,A,A,A,A
. 2014-03-05 16:00:17.157 Simple channel: Yes
. 2014-03-05 16:00:17.157 Return code variable: Autodetect; Lookup user groups: A
. 2014-03-05 16:00:17.157 Shell: default
. 2014-03-05 16:00:17.157 EOL: 0, UTF: 2
. 2014-03-05 16:00:17.157 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2014-03-05 16:00:17.157 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2014-03-05 16:00:17.157 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2014-03-05 16:00:17.157 Cache directory changes: Yes, Permanent: Yes
. 2014-03-05 16:00:17.157 DST mode: 1; Timezone offset: 0h 0m
. 2014-03-05 16:00:17.157 --------------------------------------------------------------------------
. 2014-03-05 16:00:17.158 Looking up host "domain.com"
. 2014-03-05 16:00:17.163 Connecting to xxx.xxx.xxx.xxx port 22
. 2014-03-05 16:00:17.214 Waiting for the server to continue with the initialization
. 2014-03-05 16:00:17.214 Detected network event
. 2014-03-05 16:00:17.269 Detected network event
. 2014-03-05 16:00:17.269 Server version: SSH-2.0-OpenSSH_3.9p1
. 2014-03-05 16:00:17.269 Using SSH protocol version 2
. 2014-03-05 16:00:17.269 We claim version: SSH-2.0-WinSCP_release_5.5.1
. 2014-03-05 16:00:17.269 Waiting for the server to continue with the initialization
. 2014-03-05 16:00:17.319 Detected network event
. 2014-03-05 16:00:17.320 Doing Diffie-Hellman group exchange
. 2014-03-05 16:00:17.320 Waiting for the server to continue with the initialization
. 2014-03-05 16:00:17.461 Detected network event
. 2014-03-05 16:00:17.461 Doing Diffie-Hellman key exchange with hash SHA-1
. 2014-03-05 16:00:17.547 Waiting for the server to continue with the initialization
. 2014-03-05 16:00:17.623 Detected network event
. 2014-03-05 16:00:17.702 Verifying host key rsa2 0x23, long string with fingerprint ssh-rsa 1024 KEY
. 2014-03-05 16:00:17.702 Host key matches configured key
. 2014-03-05 16:00:17.702 Host key fingerprint is:
. 2014-03-05 16:00:17.702 ssh-rsa 1024 KEY
. 2014-03-05 16:00:17.702 Initialised AES-256 SDCTR client->server encryption
. 2014-03-05 16:00:17.702 Initialised HMAC-SHA1 client->server MAC algorithm
. 2014-03-05 16:00:17.702 Initialised AES-256 SDCTR server->client encryption
. 2014-03-05 16:00:17.702 Initialised HMAC-SHA1 server->client MAC algorithm
. 2014-03-05 16:00:17.702 Waiting for the server to continue with the initialization
. 2014-03-05 16:00:17.843 Detected network event
! 2014-03-05 16:00:17.844 Using username "username".
. 2014-03-05 16:00:17.844 Waiting for the server to continue with the initialization
. 2014-03-05 16:00:17.895 Detected network event
. 2014-03-05 16:00:17.895 Prompt (7, SSH password, , &Password: )
... "open sftp://user@domain.com/ -hostkey=""ssh-rsa 1024 HostKey""" ...]