【问题标题】:How to establish AWs Systems Manager PortForwarding session? Unknown session type Port如何建立 AWs Systems Manager PortForwarding 会话?未知会话类型端口
【发布时间】:2020-02-18 22:23:32
【问题描述】:

我正在尝试对 AWS Systems Manager Session Manager Port Forwarding 会话进行 POC,但我似乎无法启动 PortForwarding 会话,即使启动正常会话也是如此。

会话开始并按预期工作 aws ssm start-session --target i-xxxxxxxxxxx

aws ssm start-session --target i-xxxxxxxxxxx \
                       --document-name AWS-StartPortForwardingSession \
                       --parameters '{"portNumber":["80"],"localPortNumber":["3001"]}'

IAM 角色具有 AWS 策略 AmazonSSMManagedInstanceCore 和会话管理器策略

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ssmmessages:CreateControlChannel",
                "ssmmessages:CreateDataChannel",
                "ssmmessages:OpenControlChannel",
                "ssmmessages:OpenDataChannel"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetEncryptionConfiguration"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "kms:Decrypt"
            ],
            "Resource": "arn:aws:kms:us-east-2:xxxxxxxxxxx:key/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxx"
        }
    ]
}

我希望会话建立隧道并开始将端口 80 转发到我的本地端口 3001

相反,我收到以下错误:

SessionId xxxx-xxxxxxxxxxx

----------ERROR-------
Encountered error while initiating handshake. SessionType failed on client with status 2 error: Failed to process action SessionType: Unknown session type Port```

Here is what I am trying to accomplish: 

https://aws.amazon.com/blogs/aws/new-port-forwarding-using-aws-system-manager-sessions-manager/

【问题讨论】:

    标签: amazon-web-services amazon-systems-manager aws-session-manager


    【解决方案1】:

    我遇到了同样的问题,结果证明它是用于 aws cli 的过时 AWS 会话管理器插件。更新插件后它工作了。

    安装/更新插件的说明是here

    【讨论】:

      猜你喜欢
      • 2020-07-30
      • 1970-01-01
      • 2020-01-15
      • 2014-11-12
      • 2021-04-15
      • 1970-01-01
      • 2020-12-24
      • 2021-11-27
      • 2020-06-24
      相关资源
      最近更新 更多