我需要将.csv文件上传到SFTP。我有一个.ppk文件
我的WinSCP脚本:
open sftp://ex@ex.com/ -privatekey=ssh.ppk
lcd Z:\TR TEM DATA\
cd /home/cli/mm/gns
ascii
put -transfer=ascii -latest *.csv
exit
错误:
Searching for host...
Connecting to host...
Authenticating...
Expected host key was not configured, use -hostkey switch
日志文件还包含:
文件错误:
Server also has ssh-dss host key, but we don't know it
有人可以建议
谢谢
答案 0 :(得分:0)
由于错误消息提示您,您的open
命令丢失了-hostkey
switch。
请参阅:
最简单的解决方案是拥有WinSCP GUI generate a script template for you。
顺便说一句,您的问题与.ppk /私钥无关。参见Understanding SSH key pairs。