在AWS启动实例时,是否有一种方法可以禁用创建.pem文件?

发布于 2025-01-25 06:39:11 字数 66 浏览 2 评论 0原文

我的问题是:说用户想在AWS中启动一个实例。有没有办法告诉AWS不要让他们使用.pem文件启动它?任何帮助将不胜感激!

My question is about this: Let´s say a user wants to launch an instance in AWS. Is there a way to tell AWS to not let them launch it with a .pem file? Any help would be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妄想挽回 2025-02-01 06:39:11

使用AWS CLI时,- 键 - 名称参数是可选的。来自此链接

以下run-Instances示例将类型t2.micro的单个实例启动到当前区域的默认子网中,并将其与默认子网相关联该地区的VPC。 如果您不打算使用SSH(Linux)或RDP(Windows)

aws ec2 run-instances \
    --image-id ami-0abcdef1234567890 \
    --instance-type t2.micro \
    --key-name MyKeyPair

(大胆的文本矿山)因此,从CLI创建时,您无需提供钥匙对。但是,旋转EC2的UI似乎需要密钥对。

When using the AWS CLI, the --key-name parameter is optional. From this link

The following run-instances example launches a single instance of type t2.micro into the default subnet for the current Region and associates it with the default subnet for the default VPC for the Region. The key pair is optional if you do not plan to connect to your instance using SSH (Linux) or RDP (Windows).

aws ec2 run-instances \
    --image-id ami-0abcdef1234567890 \
    --instance-type t2.micro \
    --key-name MyKeyPair

(Bold text mine) So you do not need to supply a key pair when creating from the CLI. However, it looks like the UI to spin up an EC2 requires the key pair though.

谁与争疯 2025-02-01 06:39:11

当您从GUI控制台或AWS CLI创建任何AWS EC2实例时,附加Keypair始终是可选的
可以在不使用.pem文件的情况下创建AWS EC2实例,而且如果您配置了 Session Manager ,则可以使用AWS Console GUI登录它。

aws ec2 runstances
- 图像ID< Ami-id>
- 实施型<实例型>
-subnet-id<子网ID>
- 安全组IDS<安全组ID> <安全组-ID>

您可以在CLI命令中删除此参数,并且可以在没有pem文件的情况下完成必要的内容。

-Key-Name< EC2键配对名称>

While You Creating any AWS EC2 instance from the GUI console or AWS CLI, attaching KeyPair is always optional to it.
an AWS EC2 instance can be created without using the .pem file and also if you configure the session manager, you can log in to it using AWS Console GUI.

aws ec2 run-instances
--image-id < ami-id>
--instance-type < instance-type>
--subnet-id < subnet-id>
--security-group-ids < security-group-id> < security-group-id>

you can remove this parameter in the CLI command and that will do the needful without.pem file.

--key-name < ec2-key-pair-name>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文