issue with private key generation in WiScp

Advertisement

kavithakutty
Guest

issue with private key generation in WiScp

Hi,


I need to use shell script to sftp some files from windows to unix.I have Winscp installed in my Windows machine.I generated private key and public key through PUTTYgen .And then copied both of the files private and public to the .ssh diretory in the unix server.After that i tried to login Winscp through the private key file .I have given the correct file path in my login session.But it displays an error message that "SERVER REUSED OUR KEY".
Can anybody help me to resolve this issue?
I can login to Winscp with my unix server password successfully.

Regards
kavitha

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,266
Location:
Prague, Czechia

Re: issue with private key generation in WiScp

First, never upload private key to the server!
Then, you should check documentation of your SSH server to learn in what format to upload the public key.
_________________
Martin Prikryl

Reply with quote

Guest

Hi,

Thanks for your reply.This is the first time I am automating the shell script to sftp the files .Could you please tell me how can I know the format of my public key in the unix server.?Also the The Winscp which I have got installed is the client version.So Would that be enough to automate the sftp process through shell script.

Thanks

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
29,266
Location:
Prague, Czechia

Thanks for your reply.This is the first time I am automating the shell script to sftp the files .Could you please tell me how can I know the format of my public key in the unix server.?
I do not know what your SSH server is. Even if I know, still, you should seek advice from its vendor.

Also the The Winscp which I have got installed is the client version.So Would that be enough to automate the sftp process through shell script.
Sure. There's no server version either.
_________________
Martin Prikryl

Reply with quote

Guest

Hi,
Thanks for your advice.
I resolved the issue with private key.I generated the private key in unix box and ftpd that into the windows PC and saved it into the PUTTYgen.Now I am able to login to unix server from windows without giving password through winscp.But when i tried the below mentioned commands in command prompt it displays the error message that "Authentication failed".

winscp> option batch on
batch           on
winscp> option confirm off
confirm         off
winscp> open abc5328@17.22.21.166
Searching for host...
Connecting to host...
Authenticating...
Using username "abc5328".
Authenticating with public key "imported-openssh-key".
Passphrase for key 'imported-openssh-key':
Wrong passphrase.
Passphrase for key 'imported-openssh-key':
Connection has been unexpectedly closed. Server sent command exit status 0.
Authentication log (see session log for details):
Using username "abc5328".
Authenticating with public key "imported-openssh-key".
Wrong passphrase.

Authentication failed.
I have given the correct passphrase and I can login successfully with this passphrase to the unix server through winscp.Could you please help on this?Since i need to call this in a batch file I dont want to enter the passphare.How can i avoid this option.Please guide me on this
Thanks

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,266
Location:
Prague, Czechia

Please read FAQ. If that does not help, come back.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum