amazon-web-services - 如何通过 SSH 连接到 Redhat EC2 实例?

标签 amazon-web-services amazon-ec2 ssh redhat

我已阅读 AWS docs这说我应该使用:

ssh -i /path/my-key-pair.pem my-instance-user-name@my-instance-public-dns-name

但我不知道 my-instance-user-name 应该是什么。


对于 Ubuntu,我总是这样做

ssh -i /path/my-key-pair.pem ubuntu@my-instance-public-dns-name

通过chmod 400/path/my-key-pair.pem更改我的 key 的权限后

最佳答案

对于红帽 (RHEL) it will be ec2-用户。对于其他操作系统,列表为 here :

  • For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.

  • For a CentOS AMI, the user name is centos or ec2-user.

  • For a Debian AMI, the user name is admin.

  • For a Fedora AMI, the user name is fedora or ec2-user.

  • For a RHEL AMI, the user name is ec2-user or root.

  • For a SUSE AMI, the user name is ec2-user or root.

  • For an Ubuntu AMI, the user name is ubuntu.

  • For an Oracle AMI, the user name is ec2-user.

  • For a Bitnami AMI, the user name is bitnami.

  • Otherwise, check with the AMI provider.

关于amazon-web-services - 如何通过 SSH 连接到 Redhat EC2 实例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69703353/

相关文章:

amazon-web-services - 有什么方法可以编辑在 AWS 中用于自动扩展的 AMI?

linux - 我在哪里可以找到 Amazon Linux 上的 “libgconf-2.so.4()(64bit)” 和 “xdg-utils” 依赖项?

linux - 如何找出我在 Amazon EC2 上的存储空间已满的原因?

PHP Git 从 GitHub 脚本 SSH pull

amazon-web-services - AWS CloudFormation 停留在 CREATE_IN_PROGRESS

amazon-web-services - SNS订阅的应用协议(protocol)是什么?

mysql - EC2 服务器故障排除

ssh - 无法在基本初始化中建立 Vagrant SSH key 使用连接(authorized_keys 权限问题)

Java JSchException : Auth cancel

node.js - 在 AWS Lambda 函数中找不到模块