【问题标题】:Setting SFTP Sublime Text 3 for EC2 Amazon Linux Instance为 EC2 Amazon Linux 实例设置 SFTP Sublime Text 3
【发布时间】:2015-10-09 21:19:57
【问题描述】:

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

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

// 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,

}

【问题讨论】:

  • 尝试注释掉"ssh_key_file",看看是否可行。另外,请确保您的 .pem 文件具有正确的权限 - 它们应该是 0400
  • MattDMo,在我尝试使用用户名方法之前,我已经完成了这些事情。如果我使用的是基本的 FTP 连接,那么我不需要 SSH,对吗?
  • 否,但在设置中显示您使用的是sftp
  • 另外,我可以尝试设置(创建另一个用户并尝试基本的 FTP 方法)。我现在连接成功,但出现以下错误: Connecting to FTP server "..**.***" as "user" ..... success Validating remote folder "/home/ user/" .. failure (Folder not found) 问题似乎出在 SFTP 插件或 EC2 服务器本身的文件夹设置上。
  • 见我上面的评论。为了解决这个问题,我稍微改变了方法。

标签: linux amazon-ec2 ftp sublimetext3 sftp


【解决方案1】:

这对我有用:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-10-23
    • 1970-01-01
    • 2013-08-20
    • 2015-03-19
    • 2020-06-26
    • 2013-10-09
    • 2014-04-30
    • 1970-01-01
    相关资源
    最近更新 更多