Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No ability to get the decrypted Windows password #459

Closed
palfrey opened this issue Feb 5, 2014 · 2 comments
Closed

No ability to get the decrypted Windows password #459

palfrey opened this issue Feb 5, 2014 · 2 comments

Comments

@palfrey
Copy link

palfrey commented Feb 5, 2014

This is for example doable in the Powershell bindings (using Get-EC2PasswordData), but not in the Ruby SDK. Using EC2.client.get_password_data can be used to get the encrypted password, but there's no option to decrypt it, even if you've got the PEM...

@palfrey
Copy link
Author

palfrey commented Feb 7, 2014

Here's how to do it in your own code BTW

# pemPath is the file path of your PEM file
# instance is an AWS::EC2::Instance
ec2 = AWS::EC2.new
encrypted_password = ec2.client.get_password_data(:instance_id => instance.instance_id).password_data
private_key = OpenSSL::PKey::RSA.new(File.read(pemPath))
decoded = Base64.decode64(encrypted_password)
password = private_key.private_decrypt(decoded)

@trevorrowe
Copy link
Member

Sorry for the very slow response. We are not currently doing feature work on the v1 Ruby SDK. We do accept pull requests, but we are currently focused on the v2 SDK (https://github.com/aws/aws-sdk-core-ruby). I do think this could be a helpful feature to add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants