pgentile / iam-get-ssh-keys

Get SSH keys from AWS IAM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:Go 100.0%