[英]How do configure Coda to work for my Amazon EC2 instance?
I can not connect to my EC2 instane.我无法连接到我的 EC2 实例。 I have opened port 21 in the AWS Console.
我在 AWS 控制台中打开了端口 21。 I think there is no way of input my SSH Key pair in Coda.
我认为无法在 Coda 中输入我的 SSH 密钥对。 Is there a way of connecting Coda to my EC2 instance?
有没有办法将 Coda 连接到我的 EC2 实例?
Coda should pick up settings from your ssh config so you can configure this fairly easily. Coda 应该从您的 ssh 配置中获取设置,以便您可以相当轻松地进行配置。
If you've saved your EC2 ssh keypair in ~/.ssh/ec2_rsa then simply edit ~/.ssh/config to look like:如果您已将 EC2 ssh 密钥对保存在 ~/.ssh/ec2_rsa 中,则只需编辑 ~/.ssh/config 使其如下所示:
IdentityFile ~/.ssh/ec2_rsa
You can also restrict the IdentityFile directive to just your AWS resource with:您还可以使用以下方法将 IdentityFile 指令限制为您的 AWS 资源:
Host somehost.amazonaws.com
IdentityFile ~/.ssh/ec2_rsa
If everything's configured properly then you should be able to, from the command line, run ssh username@awshost
and get a login prompt如果一切配置正确,那么您应该能够从命令行运行
ssh username@awshost
并获得登录提示
If you continue to have problems you can always enable password authentication on your instance by editing /etc/ssh/sshd_config
and adding the line PasswordAuthentication yes
to the end of the file, then setting a password for your user with passwd
如果您仍然遇到问题,您始终可以通过编辑
/etc/ssh/sshd_config
并将PasswordAuthentication yes
行添加到文件末尾,然后使用passwd
为您的用户设置密码来在您的实例上启用密码身份验证
I use the following settings in my.ssh/config to automatically apply my EC2 keypairs for EC2 resources:我在 my.ssh/config 中使用以下设置自动将我的 EC2 密钥对应用于 EC2 资源:
# EC2 Northern Virginia
Host *.compute-1.amazonaws.com
IdentityFile ~/.keys/ssh/ec2/us_east_1.key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentitiesOnly yes
ForwardAgent no
# EC2 Northern California:
Host *.us-west-1.compute.amazonaws.com
IdentityFile ~/.keys/ssh/ec2/us_west_1.key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentitiesOnly yes
ForwardAgent no
# EC2 Ireland:
Host *.eu-west-1.compute.amazonaws.com
IdentityFile ~/.keys/ssh/ec2/eu_west_1.key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentitiesOnly yes
ForwardAgent no
# EC2 Singapore:
Host *.ap-southeast-1.compute.amazonaws.com
IdentityFile ~/.keys/ssh/ec2/ap_southeast_1.key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentitiesOnly yes
ForwardAgent no
# EC2 Tokyo:
Host *.ap-northeast-1.compute.amazonaws.com
IdentityFile ~/.keys/ssh/ec2/ap_northeast_1.key
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentitiesOnly yes
ForwardAgent no
I struggled with this for some time, so sharing important steps for me:我为此苦苦挣扎了一段时间,因此为我分享了重要的步骤:
That worked for me.这对我有用。
In the new version of Coda, there's a small icon of a key which shows up inside the password box on the right.在新版本的 Coda 中,右侧的密码框内显示了一个钥匙的小图标。 If you click this, you can browse to the PEM file and choose that as your password.
如果单击此选项,您可以浏览到 PEM 文件并选择它作为您的密码。
The icon disappears once you click the password box, and as far as I can tell you can't get it back without making a new project.一旦您单击密码框,该图标就会消失,据我所知,如果不创建新项目,您将无法取回它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.