简体   繁体   English

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

[英]Setting SFTP Sublime Text 3 for EC2 Amazon Linux Instance

I have been trying to set up a remote (FTP) access to some playground files on AWS EC2 instance. 我一直试图在AWS EC2实例上设置对某些游乐场文件的远程(FTP)访问。 Having created an FTP user and installed vsftp, I kept getting a "connection timeout" from Sublime/SFTP. 创建了FTP用户并安装了vsftp之后,我不断从Sublime / SFTP获得“连接超时”。 I decided to try the SSH key route. 我决定尝试SSH密钥路由。 Here is my server setup in SFTP. 这是我在SFTP中设置的服务器。 It also gets "connection timeout." 它还会得到“连接超时”。 What could be the reason for this? 这可能是什么原因? Is this on the client or server side? 这是在客户端还是服务器端? Now, before anyone suggests it, I do have port 22 as my SSH port in AWS Security Groups / Inbound Rules settings. 现在,在任何人建议之前,我在AWS Security Groups / Inbound Rules设置中都将端口22作为我的SSH端口。

I blanked out some entries like server, password and keyname. 我清空了一些条目,例如服务器,密码和键名。

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

} }

This worked for me: 这为我工作:

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

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

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