AWS EC2 如何 使用 SSM会话管理器登陆

首先只有特定版本的OS会默认附带SSM Agent。

预安装了 SSM Agent 的 Amazon Machine Images(AMIs) - AWS Systems Manager

AWS EC2 如何 使用 SSM会话管理器登陆_第1张图片

其次EC的instance role必须有一个叫“AmazonSSMManagedInstanceCore”的策略

AWS EC2 如何 使用 SSM会话管理器登陆_第2张图片

 

如何给IAM User赋权,让他们可以使用SSM会话:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeInstanceAttribute",
                "ec2:DescribeVolumeAttribute"
            ],
            "Resource": [
                "arn:aws-cn:ec2:*:xxxxxxxxx2:instance/*",
                "arn:aws-cn:ec2:*:xxxxxxxxx2:volume/*"
            ]
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeInstances",
                "ec2:DescribeVolumeStatus",
                "ssm:DescribeInstanceInformation",
                "ec2:DescribeTags",
                "ec2:DescribeVolumes",
                "ec2:DescribeInstanceStatus"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor2",
            "Effect": "Allow",
            "Action": [
                "ssm:GetConnectionStatus",
                "ssm:StartSession"
            ],
            "Resource": "arn:aws-cn:ec2:*:xxxxxxxxx2:instance/*"
        },
        {
            "Sid": "VisualEditor3",
            "Effect": "Allow",
            "Action": [
                "ec2:StartInstances",
                "ec2:StopInstances"
            ],
            "Resource": "arn:aws-cn:ec2:*:xxxxxxxxx2:instance/*"
        }
    ]
}

你可能感兴趣的:(aws,云计算)