4

I'm trying to connect to my server using the atom package "Remote-FTP" and using a private key.

I have the SSH keys set up on my server and can connect successfully using putty.

The private key is saved in my project folder and I have an existing .ftpconfig file (without a private key) that connects successfully when I replace the information inside the file.

The Key has been converted to the necessary ssh format and I have no passphrase at the moment. I have also gave the full path of the private key file

Here is my .ftpconfig file -

{
"protocol": "sftp",
"host": "user@server",
"port": 22,
"user": "",
"pass": "",
"promptForPass": false,
"remote": "",
"local": "",
"agent": "",
"privatekey": "putty_private_key_sbappsupconvrted.ppk",
"passphrase": "",
"hosthash": "",
"ignorehost": true,
"connTimeout": 10000,
"keepalive": 10000,
"keyboardInteractive": true,
"watch": [],
"watchTimeout": 500
}

The error code I am receiving is:

REMOTE FTP: Connection...

REMOTE FTP: Connection failed Error: getaddrinfo EAI_FAIL user@server: 22

REMOTE FTP: Connection closed

I have also given the full path of the private key file

C:\Users\user\.atom\server\putty_private_key_sbappsupconvrted.ppk

and I get this error

Could not parse .ftpconfig Unexpected token U in JSON at position 219

Any help would be greatly appreciated

Alan Kavanagh
  • 9,425
  • 7
  • 41
  • 65
D.Millin
  • 69
  • 1
  • 9
  • `"host": "user@server",` Surely this value should just be the server name, and the user name should go with the "user" key. – Kenster Jul 03 '18 at 11:41
  • When logging into Putty using the SSH key the hostname is user@server. However, I just tried this and it worked! I had to use "putty_private_key_sbappsupconvrted.ppk". Thank you so much! – D.Millin Jul 03 '18 at 12:28

2 Answers2

8

The problem is the backslashes. The .ftpconfig file is in JSON format and slash followed by character has a special meaning. To use your ssh key you just have to escape the slashes. In other words change :

C:\Users\user\.atom\server\putty_private_key_sbappsupconvrted.ppk

To :

C:\\Users\\user\\.atom\\server\\putty_private_key_sbappsupconvrted.ppk

Then it will work with no issues.

A.Nelson
  • 81
  • 1
  • 2
0

Put your private key in following path: C:\Users\USER\AppData\Local\atom\app-1.30.0

Replace USER. It seems it looks in this folder for the keys.

franiis
  • 1,378
  • 1
  • 18
  • 33
  • I do this now as well. Whenever there is an update you have to move the private key to the new version though. – D.Millin Sep 11 '18 at 08:01