简体   繁体   English

如何配置 Coda 以适用于我的 Amazon EC2 实例?

[英]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:我为此苦苦挣扎了一段时间,因此为我分享了重要的步骤:

  1. Configure an alias in /.ssh/config在 /.ssh/config 中配置别名
  2. Make sure permissions of my_key.pem makes sense, eg.确保 my_key.pem 的权限有意义,例如。 do > chmod 644 my_key.pem做 > chmod 644 my_key.pem
  3. Simply put your alias in Server field when creating SSH or SFTP session, and nothing else.只需在创建 SSH 或 SFTP session 时将您的别名放在服务器字段中,仅此而已。

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.

相关问题 如何使用Amazon EC2实例设置Mac ftp客户端? - How do I set up my mac ftp client with an amazon ec2 instance? PHP ftp连接到Amazon EC2实例 - PHP ftp connection to Amazon EC2 Instance 如何使用Java Apache FTPClient将文件从一个Amazon EC2实例下载到另一个EC2实例 - How to download file from one Amazon EC2 instance to another EC2 instance using java apache FTPClient 如何在Amazon EC2上访问pyftpdlib FTPS服务器? - How do I access pyftpdlib FTPS server on Amazon EC2? 获得使用 FTP-WinSCP 处理我的 Amazon EC2 Ubuntu 服务器上的文件的权限 - Get permission to work with files on my Amazon EC2 Ubuntu server using FTP-WinSCP 为EC2 Amazon Linux实例设置SFTP Sublime Text 3 - Setting SFTP Sublime Text 3 for EC2 Amazon Linux Instance 如何为带有IIS的Amazon EC2服务器启用FTP被动模式 - How to enable FTP Passive Mode for Amazon EC2 server with IIS 如何在Amazon EC2上将FTP服务器转换为安全SFTP - How to convert FTP server to secure SFTP on Amazon EC2 无法从 Amazon EC2 实例下的一台 FTP 服务器使用 Ruby 获取二进制文件 - Cannot get binaryfile using Ruby from one FTP server under Amazon EC2 instance PHP的FTP无法在Amazon linux EC2实例上运行? - PHP's FTP isn't working on Amazon linux EC2 instance?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM