Skip to content

pgentile/iam-get-ssh-keys

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iam-get-ssh-keys

Retrieve SSH keys for an user in AWS IAM

Usage

Get active SSH keys:

iam-get-ssh-keys USERNAME

Integrate with OpenSSH server:

AuthorizedKeysCommand /usr/bin/iam-get-ssh-keys %u
AuthorizedKeysCommandUser nobody

Don't forget to add the following policy to the role attached to your EC2 instance:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "iam:ListSSHPublicKeys",
                "iam:GetSSHPublicKey"
            ],
            "Resource": "*"
        }
    ]
}

Important

This is a proof of concept. Not ready for production use.

About

Get SSH keys from AWS IAM

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages