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

sap

Re: server sent: publickey

Thanks!
Has helped \\.
martin

Re: server sent: publickey

I guess the problem is, that you do not escape the backslashes in the path to the private key file:
sessionOptions.SshPrivateKeyPath = "C:\\WinSCPauto\\ludm2.ppk";

If this does not help, set session.SessionLogPath before calling session.Open.
sap

Re: server sent: publickey

1. session log file for script:
. 2016-03-10 20:58:05.848 --------------------------------------------------------------------------
. 2016-03-10 20:58:05.848 WinSCP Version 5.7.6 (Build 5874) (OS 6.1.7601 Service Pack 1 - Windows 7 Home Basic)
. 2016-03-10 20:58:05.848 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2016-03-10 20:58:05.848 Log level: Normal, Logging passwords
. 2016-03-10 20:58:05.848 Local account: SAP\U
. 2016-03-10 20:58:05.848 Working directory: C:\Program Files\WinSCP
. 2016-03-10 20:58:05.848 Process ID: 4556
. 2016-03-10 20:58:05.848 Command-line: winscp.exe  /console /script="C:\WinSCPscript\script1.txt" /log="C:\WinSCPscript\script1.log"
. 2016-03-10 20:58:05.848 Time zone: Current: GMT+3 (Калининградское время (зима)), No DST
. 2016-03-10 20:58:05.848 Login time: 10 Март 2016 г. 20:58:05
. 2016-03-10 20:58:05.848 --------------------------------------------------------------------------
. 2016-03-10 20:58:05.848 Script: Retrospectively logging previous script records:
> 2016-03-10 20:58:05.848 Script: open sftp://[email protected]:22/ -privatekey=C:\WinSCPscript\ppk\ludm2.ppk
. 2016-03-10 20:58:05.848 --------------------------------------------------------------------------
. 2016-03-10 20:58:05.848 Session name: [email protected] (Ad-Hoc site)
. 2016-03-10 20:58:05.848 Host name: ec2-52-32-183-91.us-west-2.compute.amazonaws.com (Port: 22)
. 2016-03-10 20:58:05.848 User name: ubuntu (Password: No, Key file: C:\WinSCPscript\ppk\ludm2.ppk)
. 2016-03-10 20:58:05.848 Tunnel: No
. 2016-03-10 20:58:05.848 Transfer Protocol: SFTP
. 2016-03-10 20:58:05.848 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2016-03-10 20:58:05.848 Disable Nagle: No
. 2016-03-10 20:58:05.848 Proxy: none
. 2016-03-10 20:58:05.848 Send buffer: 262144
. 2016-03-10 20:58:05.848 SSH protocol version: 2; Compression: No
. 2016-03-10 20:58:05.848 Bypass authentication: No
. 2016-03-10 20:58:05.848 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2016-03-10 20:58:05.848 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2016-03-10 20:58:05.848 KEX: dh-gex-sha1,dh-group14-sha1,dh-group1-sha1,rsa,WARN
. 2016-03-10 20:58:05.848 SSH Bugs: A,A,A,A,A,A,A,A,A,A,A,A
. 2016-03-10 20:58:05.848 Simple channel: Yes
. 2016-03-10 20:58:05.848 Return code variable: Autodetect; Lookup user groups: A
. 2016-03-10 20:58:05.848 Shell: default
. 2016-03-10 20:58:05.848 EOL: 0, UTF: 2
. 2016-03-10 20:58:05.848 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2016-03-10 20:58:05.848 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2016-03-10 20:58:05.848 SFTP Bugs: A,A
. 2016-03-10 20:58:05.848 SFTP Server: default
. 2016-03-10 20:58:05.848 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-03-10 20:58:05.848 Cache directory changes: Yes, Permanent: Yes
. 2016-03-10 20:58:05.848 DST mode: 1
. 2016-03-10 20:58:05.848 --------------------------------------------------------------------------
. 2016-03-10 20:58:05.848 Looking up host "ec2-52-32-183-91.us-west-2.compute.amazonaws.com"
. 2016-03-10 20:58:05.879 Connecting to 52.32.183.91 port 22
. 2016-03-10 20:58:06.379 Server version: SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.4
. 2016-03-10 20:58:06.379 Using SSH protocol version 2
. 2016-03-10 20:58:06.379 We claim version: SSH-2.0-WinSCP_release_5.7.6
. 2016-03-10 20:58:06.614 Doing Diffie-Hellman group exchange
. 2016-03-10 20:58:07.128 Doing Diffie-Hellman key exchange with hash SHA-256
. 2016-03-10 20:58:13.321 Verifying host key rsa2 0x10001,0xccc6df3d94c96247 27554a535171a5d3 8c16703bf8cd198f 57a7674c83483112 e995d03b99a31c16 4275beba1d438814 301352885c1c2f32 5fa74f181925ab25 8c8ccc548348570d 1744582492cd4416 7fc79f647a018576 a8f11a82d76a0059 11615558eca072ea 27aeeb983c5be3f3 57d46fbe9aa54e16 0ea4d88680e35bc5 37ae853cd8d04fc1 01c09549fcf5b269 3398789ea457386c ca32c1c0e6916ee5 929e57b5137cc0f5 223159d8d220ea0c ad6d039ce93e4748 712545b6b0768ae4 9f43bc24bade9418 af667c59c858b603 fbab187d3ec56c0f 5d9d15a9d100d497 f96156e64f213dd1 9b954c05df2ef33b 88947092b3493c64 36b40ec85391b4d5  with fingerprint ssh-rsa 2048 2b:3f:51:0b:27:6d:7c:76:a4:a7:0b:3c:f4:f5:a1:c6
. 2016-03-10 20:58:13.321 Host key matches cached key
. 2016-03-10 20:58:13.321 Host key fingerprint is: