【发布时间】:2015-12-22 06:51:08
【问题描述】:
我正在创建一个基于内部 AMI 的 ec2 实例,该实例使用不同的 ssh 密钥进行身份验证,而不是我想在使用刀创建的实例上使用的那个(在示例中,我称之为 original-pem -for-ami.pem):
knife ec2 server create -I ami-0123456 -f m2.xlarge \
--ssh-user username --groups sg-1234 \
--identity-file ~/.ssh/original-pem-for-ami.pem \
--node-name solr1 --hint ec2 -a public_ip_address \
--ssh-key name-of-key-i-want-to-use-to-login-to-new-instance
当我运行此命令时,服务器正确启动,分配了正确的安全组等,但我只能使用以下方式连接它:
ssh -i ~/.ssh/original-pem-for-ami.pem username@assigned-ec2-public-dns-name
有没有办法让新实例成为与命名密钥对 name-of-key-i-want-to-use-to-login-to-new-instance 关联的密钥。我认为使用 --ssh-key name-of-key-i-want-to-use-to-login-to-new-instance 可以做到这一点。
【问题讨论】:
标签: amazon-web-services amazon-ec2 chef-infra knife