linux - 为 EC2 Amazon Linux 实例设置 SFTP Sublime Text 3

标签 linux amazon-ec2 ftp sublimetext3 sftp

我一直在尝试设置对 AWS EC2 实例上某些 Playground 文件的远程 (FTP) 访问。创建了一个 FTP 用户并安装了 vsftp 后,我一直从 Sublime/SFTP 收到“连接超时”。我决定尝试 SSH key 路由。这是我在 SFTP 中的服务器设置。它还会出现“连接超时”。这可能是什么原因?这是在客户端还是服务器端? 现在,在有人建议之前,我在 AWS 安全组/入站规则设置中将端口 22 作为我的 SSH 端口。

我删除了一些条目,例如服务器、密码和 key 名。

// sftp, ftp or ftps
"type": "sftp",

"sync_down_on_open": true,
"sync_same_age": true,

"host": "ec2-xx-xx-xx-xxx.us-west-2.compute.amazonaws.com",
"user": "ec2",
//"password": "******",
"port": "22",

"remote_path": "/home/user/",
//"file_permissions": "664",
//"dir_permissions": "775",

//"extra_list_connections": 0,

"connect_timeout": 30,
//"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
"ssh_key_file": " ~/.ssh/file.pem",
//"sftp_flags": ["-F", "~/.ssh/file.pem"],
"sftp_flags": ["-o IdentityFile=/Users/user/.ssh/file.pem"]
 //"sftp_flags": ["-o", IdentityFile="/Users/user/.ssh/file.pem"],

//"preserve_modification_times": false,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,

最佳答案

这对我有用:

{
    "type": "sftp",
    "save_before_upload": true,
    "upload_on_save": false,
    "sync_down_on_open": false,
    "sync_skip_deletes": false,
    "sync_same_age": true,
    "confirm_downloads": false,
    "confirm_sync": true,
    "confirm_overwrite_newer": false,
    "host": "1.2.3.4", //IPv4 Public IP in Instances > Desription tab of EC2 Dashboard
    "user": "ec2-user",
    "port": "22",
    "remote_path": "/var/www/html/",
    "ignore_regexes": [
        "\\.sublime-(project|workspace)", "sftp-config(-alt\\d?)?\\.json",
        "sftp-settings\\.json", "/venv/", "\\.svn/", "\\.hg/", "\\.git/",
        "\\.bzr", "_darcs", "CVS", "\\.DS_Store", "Thumbs\\.db", "desktop\\.ini"
    ],
    "connect_timeout": 10,
    "ssh_key_file": "C:/Users/me/Desktop/aws.ppk", //Generated ppk file using PuTTYgen
}

关于linux - 为 EC2 Amazon Linux 实例设置 SFTP Sublime Text 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33047322/

相关文章:

linux - 如何在@string 后截一行并添加反斜杠

linux - shell 脚本错误?

node.js - NodeJs Amazon Api 和 aws

php - 试图将旧的 mysql 代码转换为 mysqli

ssh - wordmove 验证 movefile 部分 : production error This remote has not ssh nor ftp protocol defined

java - 简单的camel ftp路由超时

c - 轮询()和读取() "resource temporarily unavailable"

linux - 为模式之间的文本创建新文件

linux - 与 shell 脚本文件有关的奇怪问题

android - 如何在android应用程序和C#桌面应用程序之间建立简单的通信