Server refused our key

Advertisement

wtlinnertz
Guest

Server refused our key

I am using WinSCP 4.2.7 on WindowsXP SP3 and am having trouble using a private key when transferring files using SFTP.

When using WinSCP.exe and I set the path to my private key file I am able to authenticate to the remote site. However when I use WinSCP.com and pass the same key file path by using the -privatekey switch of the open script command I get the error "Server refused our key." I need to get the WinSCP.com to behave like WinSCP.exe.

The path I am testing with is c:\key.ppk.

Here is the script:
WinScp script
# Automatically answer all prompts negatively not to stall
# the script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
#
#Dynamic code is added below
#
open -passive -timeout=6 SFTP://userid@st.concursolutions.com -privatekey=c:\key.ppk -hostkey="ssh-rsa 2048 4f:cd:a3:33:4b:63:38:48:7a:c4:4e:25:28:3d:a2:f3"
PUT -resume c:\test.asc test.asc
close
exit    

Here is the output:
c:\winscp.com /script=st.concursolutions.com.17294.txt
batch           abort
confirm         off
Searching for host...
Connecting to host...
Authenticating...
Using username "userid".
Server refused our key.
Using keyboard-interactive authentication.
Password:
Connection has been unexpectedly closed. Server sent command exit status 0.
Authentication log (see session log for details):
Using username "userid".
Server refused our key.

Authentication failed.    

Thanks,
Todd

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Server refused our key

Can you post a full log file for both cases?
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum