1
votes

I have been trying to set up a remote (FTP) access to some playground files on AWS EC2 instance. Having created an FTP user and installed vsftp, I kept getting a "connection timeout" from Sublime/SFTP. I decided to try the SSH key route. Here is my server setup in 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.

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,

}

1
Try commenting out "ssh_key_file" and see if that works. Also, make sure your .pem file has the correct permissions - they should be 0400. - MattDMo
MattDMo, I have done those things prior to my attempts with the username method. If I am using a basic FTP connection, then I should not need an SSH, am I correct? - ArtforLife
No, but in the setting you show you're using sftp. - MattDMo
Also, I was able to play around with the settings (created another user and am trying the basic FTP method). I am now getting a successful connection but the following error: Connecting to FTP server "..**.***" as "user" ..... success Validating remote folder "/home/user/" .. failure (Folder not found) The problem seems to be with the folder setting either in the SFTP plugin or EC2 server itself. - ArtforLife
See my comment above. In my trying to get this fixed, I switched the methods a bit. - ArtforLife

1 Answers

2
votes

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
}