我创建了一个 EC2 CentOS 实例来托管我的 php web 应用程序开发版本,我使用 Sublime Text 作为 IDE,并使用 SFTP 插件直接上传文件然后进行测试。
之前,我使用带有用户名/密码/端口 22 的 SFTP 进行连接
现在,我有了 PEM 文件,我已经用它安装和配置了一些组件。如何使用 PEM 文件连接并通过 Sublime Text SFTP 插件上传文件?
我在 sftp-config.json 中指定:
"ssh_key_file": "/home/USER/USER-EC-Virginia.pem",
但没有任何成功,我收到连接超时消息。
端口 22 已允许接收流量。
编辑: 我尝试将 PPK 文件与 SublimeText 一起使用,但我仍然遇到同样的问题:超时错误。
最佳答案
你很接近...以下在 EC2 上为 CentOS/RHEL 工作
{
"type": "sftp",
"sync_down_on_open": true,
"host": "<your ec2 instance hostname>",
"user": "<your username>",
"remote_path": "<your remote path>",
"connect_timeout": 30,
"sftp_flags": ["-o IdentityFile=~<path to .pem file>"]
}
您实际上不需要设置 ssh_key_file": "/home/USER/USER-EC-Virginia.pem,
关于amazon-web-services - 使用 SublimeText SFTP 上传到 EC2 CentOS 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17265834/