简体   繁体   English

如何将Coda连接到AWS EC2实例? 用户名或密码无效

[英]How do you connect Coda to AWS EC2 Instance? Invalid username or password

I have followed the instructions in thread: How do configure Coda to work for my Amazon EC2 instance? 我已经按照线程中的说明进行操作: 如何配置Coda为我的Amazon EC2实例工作?

However, I am still having a problem. 但是,我仍然有问题。 I can ssh into my EC2 Instance by just typing ssh unbuntu@ip as well as use the terminal in Coda. 只需键入ssh unbuntu@ip以及在Coda中使用终端,我就可以进入我的EC2实例。 When I try to add a site and connect- it says User name or Password was not accepted by server. 当我尝试添加站点并连接时,它表示服务器不接受用户名或密码。

I am sure my permissions are correct (400) on my keypair located in .ssh as I can ssh into it. 我确信我的权限在我位于.ssh的密钥对上是正确的(400),因为我可以直接进入它。

My coda settings are: 我的尾声设置是:

Protocal: SFTP port 22
Server: <ip>
username: ubuntu
password: <blank>
Root URL: http://<ip>/sub

Furthermore, My .ssh directory permission is 700 and all files within are set to 400. My config file looks like: 此外,我的.ssh目录权限为700,其中的所有文件都设置为400.我的配置文件如下所示:

Host <ip>
User ubuntu
IdentityFile ~/.ssh/key.pem
HostName <ip>

Any idea what is going wrong? 什么出了什么问题? I can ssh through the terminal and use the Coda terminal; 我可以通过终端ssh并使用Coda终端; however, I says 但是,我说

"Could not connect to server xxxx: The username or password was not accepted by the server."` “无法连接到服务器xxxx:服务器不接受用户名或密码。”`

when I try to open the site using Coda. 当我尝试使用Coda打开网站时。

When creating new sites with Coda for use with EC2 Instances i've used: 使用Coda创建新站点以与我使用的EC2实例一起使用时:

Protocol: SFTP 协议:SFTP

Port: 22 港口:22

Server:ec2-xxx-xxx-xxx-xxx.eu-west-1.compute.amazonaws.com 服务器:ec2-xxx-xxx-xxx-xxx.eu-west-1.compute.amazonaws.com

User Name: ec2-user 用户名:ec2-user

Password: (Press the Key Icon and select your Key Pair) 密码:(按键图标并选择您的密钥对)

Root URL: http://whatever.com 根URL: http//whatever.com

Remote Root: /var/www/html/whatever.com 远程Root:/var/www/html/whatever.com

Local Root: /Volumes/Macintosh HD/Users/Alex/Location/Location/Location 本地根:/ Volumes / Macintosh HD / Users / Alex / Location / Location / Location

Press SAVE and it's done. 按SAVE即可完成。

You can also create an ~/.ssh/config file: 您还可以创建~/.ssh/config文件:

# AWS Ec2 Ireland
Host *.eu-west-1.compute.amazonaws.com
IdentityFile /location/of/your/pem/file/dublin.pem
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
IdentitiesOnly yes
ForwardAgent no

尝试使用空白密码将用户名设置为“ec2-user”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM