Topic "issue with private key generation in WiScp"

Author Message
kavithakutty

Guest


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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Quote:
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.

Quote:
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
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".

Code:
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Please read FAQ. If that does not help, come back.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License