2

I'm trying to receive the default Windows password so I can RDP into my EC2 instance. According to the AWS documentation, it's just as simple as sharing the contents of the Key Pair that used during the creation of the instance.

However when I do that, I get the following error:

There was an error decrypting your password. Please ensure that your private key is not encrypted.

Looking at my .pem file, the contents do appear to be encrypted:

enter image description here

So I've tried to decrypt the RSA key using the following command in macOS (taken from this question):

base64 -D -i /Users/home/desktop/pw.txt | openssl rsautl -decrypt -inkey $HOME/aws-remote.pem

But I keep getting the following error in Terminal:

Error reading input Data

The .pem file is being found OK (it gives another error if it can't find it). What am I doing wrong?

Django Reinhardt
  • 2,256
  • 3
  • 38
  • 55
  • I've moved this over from SO because it was the wrong SE for this type of question – Django Reinhardt May 13 '18 at 17:45
  • 4
    Possible duplicate of [Windows Password won't decrypt on AWS EC2 even with the correct private key](https://serverfault.com/questions/603984/windows-password-wont-decrypt-on-aws-ec2-even-with-the-correct-private-key) – Luca Gibelli May 14 '18 at 06:31
  • @LucaGibelli I literally linked to that question in my answer and explained how it didn't solve me problem :-/ – Django Reinhardt May 16 '18 at 17:11
  • Well, but you do admit that the question is the same :) the answers might not solve your problem, but the question is the same – Luca Gibelli May 16 '18 at 18:12
  • @LucaGibelli The accepted solution in that question doesn't solve my problem, ergo the problem is actually different. If the problem is different, it's not a duplicate. – Django Reinhardt May 17 '18 at 12:47

2 Answers2

0

If you have a .ppk file, you can convert it to .pem using PuttyGen.

  1. Load your .ppk file:
    enter image description here

  2. Export it as OpenSSH format:
    enter image description here

Andrey
  • 101
  • 1
0

I started searching for other solutions and came across something which fixed the problem for me:

openssl rsa -in $HOME/.ssh/aws-remote -out /Users/home/desktop/unecrypted-rsa.txt

Amazon was happy and I got my Windows password. Woo!

Django Reinhardt
  • 2,256
  • 3
  • 38
  • 55