icetee / remote-ftp

FTP/FTPS/SFTP client for Atom.io
MIT License
558 stars 102 forks source link

Amazon Web Services : EC2 #644

Open Stefanbracke opened 7 years ago

Stefanbracke commented 7 years ago

Does anyone have an clear and working example of a .ftpconfig for an AWS EC2 sftp connection? (using a pem-file)

philliptmaddox commented 7 years ago

I'm also having issues. I can connect with terminal over SSH and in FileZilla so I know my host name, user and key are good.

Stefanbracke commented 7 years ago

Same here, Phillip, everything works in Coda 2.5 : an application on osx i try to get away from but atom won't let me... sigh..

jackalstomper commented 7 years ago

Been using this to connect to EC2 instances just fine

{
    "protocol": "sftp",
    "host": "host-endpoint",
    "port": 22,
    "user": "username",
    "remote": "remote/working/directory",
    "local": "",
    "agent": "",
    "privatekey": "path/to/local/pemfile",
    "promptForPass": true,
    "keepalive": 10000,
    "keyboardInteractive": false
}
Stefanbracke commented 7 years ago

Why would you set promotForPass to true? Which pass should you enter?The user is "ec2-user" right?

jackalstomper commented 7 years ago

promptForPass is for the pem/ppk file password (if set). Not for the ec2 user password.

What you're thinking of is the keyboardInteractive field. Which allows username/password logins to the target machine.

I only allow private key authentication for my EC2 instance logins, so I set keyboardInteractive to false.

hatzopoulos commented 7 years ago

Thanks for the helpful information @jackalstomper

Linking to https://github.com/mgrenier/remote-ftp/issues/7 for when someone updates the docs.

philliptmaddox commented 7 years ago

This is my config that's still not working:

{
    "protocol": "sftp",
    "host": "PUBLIC_DNS",
    "port": 22,
    "user": "USERNAME",
    "pass": "",
    "promptForPass": false,
    "remote": "/opt/bitnami/apps/wordpress/htdocs",
    "local": "PATH_TO_LOCAL_DIR",
    "agent": "",
    "privatekey": "PATH_TO_LOCAL_KEY",
    "passphrase": "",
    "hosthash": "",
    "ignorehost": true,
    "connTimeout": 10000,
    "keepalive": 10000,
    "keyboardInteractive": false,
    "watch": [],
    "watchTimeout": 500
}
jpxd commented 7 years ago

@philliptmaddox Any error messages? Is your privatekey unencrypted and readable to the user who executes Atom? If the key can't be read it's unfortunately just silently ignored You could try to set "debug":true in the .ftpconfig and see what the developer console reads...

philliptmaddox commented 7 years ago

The private key is unencrypted and should not be the issue.

This is all I'm getting: Remote FTP: Error: All configured authentication methods failed

I'm wondering if my file path is right for ssh? "~/.ssh/NameofKey.pem"

jpxd commented 7 years ago

Did you try an absolute path?

jpxd commented 7 years ago

Yes, thats the issue! Use an absolute path instead of the ~ bit for your homedir.

screenshot 2017-01-23 23 26 55

I've now added an error popup when the privateKey file can't be read :)

Stefanbracke commented 7 years ago

Still doesn't work: Remote FTP: Error: All configured authentication methods failed . (nothing showing up in console)

{ "protocol": "sftp", "host": "152.128.231.81", "port": 22, "user": "ec2-user", "promptForPass": false, "remote": "/opt/app/current/www", "agent": "", "privatekey": "/Users/stef/Documents/AWS/awsec2specifickeyforthiswebsite.pem", "passphrase": "", "ignorehost": true, "conTimeout": 10000, "keepalive": 10000, "debug": true, "keyboardInteractive": false, "watch": [], "watchTimeout": 500 }

philliptmaddox commented 7 years ago

@jpxd that did it. Thanks!

@Stefanbracke if you're using bitnami, try 'bitnami' as the user instead of ec2-user

samifouad commented 7 years ago

@Stefanbracke If you're using Windows, you should be adding C: before /Users

Similar for other OS... it is best if you're starting from the absolute root of the drive the key is on and address your way to the folder without any relative paths

andrew-linck commented 5 years ago

I had an issue where it couldn't read the private key file on my local computer I had ~/.ssh permissions set to 700 I had ~/.ssh/key set to 600

to fix it I set ~/.ssh permissions set to 770 I set ~/.ssh/key set to 660