I have the public key with me(the pub file), for using sftp with public key authentication mode. How do i use sftp command for testing transfer file from my machine to the sftp server. For username and password authentication, I can transfer the files. However not sure on the commands and configuration we should use for sftp in public key authentication mode. The public key is a .pub extension file, starting with 'ssh-dss'. I have winscp and putty.

Also how do I check for the logs/reasons in case if the file transfer is a failure. I undertstand that the settings at the server side should also be proper.


You cannot connect with public key only, you need to have a private key too.

You need to generate a private/public key pair (e.g. using PuTTYgen) and register the public key on the server. Then you use the private key with your client (be it WinSCP, PuTTY or any other SSH client).

See WinSCP guide for public key authentication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.