使用 SublimeText SFTP 上传到 EC2 CentOS 实例 [英] Uploading to EC2 CentOS instance using SublimeText SFTP

查看:35
本文介绍了使用 SublimeText SFTP 上传到 EC2 CentOS 实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 EC2 CentOS 实例来托管我的 php Web 应用程序开发版本,我使用 Sublime Text 作为 IDE,并使用 SFTP 插件直接上传文件然后进行测试.

I created an EC2 CentOS instance to host my php web app development version, I'm using Sublime Text as an IDE, and SFTP plugin to upload files directly then test.

之前,我使用 SFTP 和用户名/密码/端口 22 进行连接

Before, I was using SFTP with username/password/port 22 to connect

现在,我有了 PEM 文件,并且我已经使用它来安装和配置一些组件.如何使用 PEM 文件连接并通过 Sublime Text SFTP 插件上传文件?

Now, I have the PEM file, and I already used it to install and configure some component. How can I connect using the PEM file and upload file via Sublime Text SFTP plugin?

我在 sftp-config.json 中指定:

I specified in sftp-config.json:

"ssh_key_file": "/home/USER/USER-EC-Virginia.pem",

但没有任何成功,我收到连接超时消息.

but without any success, I get Connection timeout message.

端口 22 已允许接收流量.

Port 22 already allowed to receive traffic.

我尝试将 PPK 文件与 SublimeText 一起使用,但我仍然得到相同的结果:超时错误.

I tried to use PPK file with SublimeText and I'm still getting the same : Timeout error.

推荐答案

你已经接近了...以下适用于 EC2 上的 CentOS/RHEL

You're close...the following works for CentOS / RHEL on EC2

{
    "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,

这篇关于使用 SublimeText SFTP 上传到 EC2 CentOS 实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆