Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploading to EC2 CentOS instance using SublimeText 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.

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

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?

I specified in sftp-config.json:

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

but without any success, I get Connection timeout message.

Port 22 already allowed to receive traffic.

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

like image 623
Hamza Avatar asked Jun 23 '13 22:06

Hamza


2 Answers

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

You actually don't need to set ssh_key_file": "/home/USER/USER-EC-Virginia.pem,

like image 178
One Bad Panda Avatar answered Oct 25 '22 07:10

One Bad Panda


Just to add to One Bad Panda's comment, Please dont use these commands in Windows 7 to point to key file

"sftp_flags": ["-i /C/cygwin/home/Ehsan/.ssh/ekia_ec2.pem"]

"sftp_flags": ["-o IdentityFile=/C/cygwin/home/Ehsan/.ssh/ekia_ec2.pem"]

instead use

"ssh_key_file": "C:/.../yourkey.ppk"
like image 38
rahulthakur319 Avatar answered Oct 25 '22 05:10

rahulthakur319