我刚刚在亚马逊EC2上启动了一个Ubuntu服务器AMI。
我成功连接上了,但是我没有看到任何关于默认登录凭据的信息。
我成功连接上了,但是我没有看到任何关于默认登录凭据的信息。
login as: ?
login as: ?
ssh ubuntu@host
而不是 ssh -i your-ssh-key.pem ubuntu@host
。我写了一篇文章,描述了如何做到这一点:
将个人 SSH 密钥上传到 Amazon EC2
http://alestic.com/2010/10/ec2-ssh-keys
ubuntu
登录 EC2 主机,甚至可以将其设置为在使用标准 EC2 实例的公共主机名时的默认值。这样,您只需输入 ssh hostname
。要做到这一点,请编辑 $HOME/.ssh/config
并添加以下部分:Host *.amazonaws.com
User ubuntu
~/.ssh/
并在~/.ssh/config
中添加以下内容:Host ec2-xxx-xxx-xxx-xxx.xxxx.compute.amazonaws.com
User ubuntu
IdentityFile ~/.ssh/yourkey.pem
ssh ec2-xxx-xxx-xxx-xxx.xxxx.compute.amazonaws.com
如果您的EC2已注册到域名,则还可以使用以下方法:Host yourdomain.com
User ubuntu
IdentityFile ~/.ssh/yourkey.pem
ssh yourdomain.com
最后,为了简化操作而不使用域名,可以使用以下别名:Host myalias
HostName ec2-xxx-xxx-xxx-xxx.xxxx.compute.amazonaws.com
User ubuntu
IdentityFile ~/.ssh/yourkey.pem
ssh myalias
。nologin
脚本会告诉你(通过ssh -i pem.pem root@<private.ip.ec2.instance>
),你应该使用哪个用户。ec2-user
。所以使用ssh -i pem.pem ec2-user@private.ip.ec2.instance
。
在Ubuntu AMI镜像中,这个用户是ubuntu
。
然后,在托管实例中又不同了;EMR节点使用hadoop
。