1

I am attempting to transfer files to my ec2 instance using pscp on windows. I've already connected to the instance with ssh via putty. However, pscp is unable to open the ppk file used to authenticate. I checked the permissions of the ppk file and ensured that the path is correct. Why can't I connect?

Here is the command I have been running:

pscp -i C:Desktop/xxx.ppk ../some-filename ec2-user@:/home/ec2-user/some-filename

I am receiving this error:

Unable to use key file "C:Desktopxxx.ppk" (unable to open file) Fatal: Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)

Corey Davis
  • 37
  • 2
  • 6

2 Answers2

0

Here is an example of how I copy a file from my windows machine to my linux machine

C:\Users...\Downloads>pscp -i "DEV_IRM.ppk" product-sp-4.2.0-rc2.tar.gz prvclouduser@10.149.139.26:/home/prvclouduser/sp420

Make sure that you are in the directory where the file you want to copy is located. In my case 'Downloads' directory.

Private key for access: DEV_IRM.ppk

My linux server: prvclouduser@10.149.139.26

The landing directory in linux: /home/prvclouduser/sp420 (make sure this exists; do pwd to confirm full path)

Y. Eman
  • 33
  • 9
  • 1
    I am still getting the same error. It says it cannot use the key file (unable to open) – Corey Davis Aug 01 '18 at 03:05
  • Does it matter where my .ppk file is located? – Corey Davis Aug 01 '18 at 03:08
  • 1
    The location of your .ppk is very important. You are also using "/" which should be "\" because your are running it in windows environment. For example, you have "pscp -i C:Desktop/xxx.ppk ..." which should be "pscp -i C\:Desktop\xxx.ppk ..." – Y. Eman Aug 01 '18 at 03:22
  • To make things simpler, put .ppk file and the file you want to copy (your source file) all in the same directory, then, you don't have to worry about getting the path correct in your command. – Y. Eman Aug 01 '18 at 15:38
0

Your ".ppk" file location is important. Make sure that the directory you are in and the directory of the ".ppk" file are the same. I got the same error, i solved it by correcting the directories