[Enter steps to reproduce below:]
As I have configured the ssh-agent, it really does not make sense that I have to provide a passphrase for the agent here, as the agent is active and has been logged in with a passphrase. I really should not provide an unencoded passphrase in the config file.
Atom Version: 1.0.2
System: Mac OS X 10.10.3
Thrown From: Remote-FTP package, v0.7.1
Uncaught Error: Encrypted private key detected, but no passphrase given
At /Users/klay6683/.atom/packages/Remote-FTP/node_modules/ssh2/lib/client.js:152
Error: Encrypted private key detected, but no passphrase given
at Client.connect (/Users/klay6683/.atom/packages/Remote-FTP/node_modules/ssh2/lib/client.js:152:15)
at ConnectorSFTP.module.exports.ConnectorSFTP.connect (/Users/klay6683/.atom/packages/Remote-FTP/lib/connectors/sftp.js:78:13)
at Client.module.exports.Client.connect (/Users/klay6683/.atom/packages/Remote-FTP/lib/client.js:198:18)
at Client.<anonymous> (/Users/klay6683/.atom/packages/Remote-FTP/lib/views/tree-view.js:178:28)
at /Users/klay6683/.atom/packages/Remote-FTP/lib/client.js:87:14
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:379:3)
-7:26.4.0 core:move-down (atom-text-editor.editor.is-focused)
3x -7:26.2.0 core:move-right (atom-text-editor.editor.is-focused)
-7:24.6.0 core:backspace (atom-text-editor.editor.is-focused)
-7:18.9.0 core:move-down (atom-text-editor.editor.is-focused)
-7:18.2.0 core:save (atom-text-editor.editor.is-focused)
-7:08.4.0 remote-ftp:connect (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
-2:41.1.0 core:move-right (atom-text-editor.editor.is-focused)
2x -2:39.5.0 core:backspace (atom-text-editor.editor.is-focused)
-2:34.9.0 core:save (atom-text-editor.editor.is-focused)
-1:48.8.0 core:backspace (atom-text-editor.editor.is-focused)
-1:45.2.0 core:save (atom-text-editor.editor.is-focused)
-1:19.5.0 core:backspace (atom-text-editor.editor.is-focused)
-1:13.1.0 core:save (atom-text-editor.editor.is-focused)
9x -0:27.6.0 core:backspace (atom-text-editor.editor.is-focused)
-0:25.8.0 core:save (atom-text-editor.editor.is-focused)
6x -0:09.9.0 core:backspace (atom-text-editor.editor.is-focused)
{
"core": {}
}
# User
Remote-FTP, v0.7.1
atom-beautify, v0.28.7
autocomplete-python, v0.5.1
color-picker, v2.0.10
git-diff-details, v0.18.0
git-log, v0.4.1
language-gitignore, v0.2.0
linter-flake8, v1.5.0
minimap, v4.11.2
minimap-git-diff, v4.1.7
my-github-profile, v0.2.1
project-manager, v1.15.11
remote-atom, v1.2.6
tab-numbers, v0.2.0
travis-ci-status, v0.16.0
tree-view-git-modified, v0.5.10
tree-view-git-status, v0.1.1
# Dev
No dev packages
I don't use a keyagent myself (so I might not know what I am talking about) but please try to leave out the path to the private key, the keyagent stores the keys. At least this what I can guess from the ssh2 lib (https://github.com/mscdex/ssh2/blob/d656051e812f44b626951417d731263a9c08f5ff/lib/client.js#L152)
Having the same issue, having a working sftp module is all that is keeping me from moving to Atom completely. In Sublime Text I use SFTP from wbond, it doesn't ask for my passphrase when i connect. Here is my config for it.
'''{
"type": "sftp",
"save_before_upload": true,
"upload_on_save": true,
"sync_down_on_open": false,
"sync_skip_deletes": false,
"sync_same_age": true,
"confirm_downloads": false,
"confirm_sync": false,
"confirm_overwrite_newer": false,
"host": "host",
"user": "root",
//"password": "password",
//"port": "22",
"remote_path": "/",
"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"
],
//"file_permissions": "664",
//"dir_permissions": "775",
"extra_list_connections": 4,
"connect_timeout": 30,
"keepalive": 120,
//"ftp_passive_mode": true,
//"ftp_obey_passive_host": false,
"ssh_key_file": "~/.ssh/id_rsa",
//"sftp_flags": ["-F", "/path/to/ssh_config"],
"preserve_modification_times": true,
//"remote_time_offset_in_hours": 0,
//"remote_encoding": "utf-8",
//"remote_locale": "C",
//"allow_config_upload": false,
}''''
I'm sorry, I had to stop using Atom for it's lack of performance, so please don't wait for me if you want to close this issue.
While michaelaye may have moved on from Atom, this is still an issue for me (and likely other Atom-on-OSX users who use encrypted keys). I can create a new issue, but when the error pops up Atom gives me a link to this issue, so keeping progress here might make sense.
Ok, so poking at this a bit more, it seems that @jpxd 's comment about the empty path for the privatekey option and the "agent": "env" tip #99 together allow the OSX ssh-agent to work. I've now gotten remote-ftp connecting to a remote host reliably using my encrypted private key and ssh-agent preventing the need for me to enter my password every single save with the following .ftpconfig:
{
"protocol": "sftp",
"host": "hostname.domain.edu",
"port": 22,
"user": "username",
"pass": "",
"promptForPass": false,
"remote": "/home/username/path/to/project",
"agent": "env",
"privatekey": "",
"passphrase": "",
"hosthash": "",
"ignorehost": true,
"connTimeout": 10000,
"keepalive": 10000,
"keyboardInteractive": false
}
The one outstanding issue I've had with this configuration is that remote-ftp fails with the following message rather than prompting for my ssh-key pass-phrase if the key is new or I haven't stored the ssh-key's passphrase in the OSX Keychain:

The solution to this is easy: Open a terminal and run ssh hostname.domain.edu to have the terminal prompt for the pass-phrase and add the key to the running ssh-agent, but having Atom initiate the prompt would be more clear.
@adamfranco your solution unfortunately doesn't work for me under Ubuntu 14.04.
I obviously don't want to provide my passphrase in an unencrypted config file. I don't think anybody would really want that ;-) Is there any solution in sight? This for me would also be an important missing feature to change from ST3 to Atom
This thread is a old, but just in case someone else stumbles on this, I solution that worked for me is to set the privatekey field to the path to my encrypted key, and then set promptForPass to true, and Remote-FTP will prompt you for your passphrase when it tries to connect.
@dnunn1 but in this case the private key is not used and the password entered is used to login to the server. This only worked in your case because the ssh user password and the private key password matched.
For me the solution presented by @adamfranco worked wonders. Although, as he notes, I already had the key's passphrase added to my OS keychain.
For reference to open source lovers the workaround from @adamfranco also works on GNU/Linux :+1:
Just tested it with Ubuntu 18.04 for evaluating Atom and the ssh-agent integration works with the graphical GNOME popup on first unlock of the private key. But it seems not to work with referencing the host entries from ~/.ssh/config and unfortunately only with configuring it fully like this:
{
"protocol": "sftp",
"host": "******",
"port": 22,
"user": "******",
"pass": "",
"promptForPass": false,
"remote": "/home/******",
"agent": "env",
"privatekey": "",
"passphrase": "",
"hosthash": "",
"ignorehost": true,
"connTimeout": 10000,
"keepalive": 10000,
"keyboardInteractive": false
}
But this is still just a workaround and probably won't work when using multiple private keys (neither via ~/.ssh/config nor .ftpconfig)!
Most helpful comment
Ok, so poking at this a bit more, it seems that @jpxd 's comment about the empty path for the
privatekeyoption and the"agent": "env"tip #99 together allow the OSX ssh-agent to work. I've now gotten remote-ftp connecting to a remote host reliably using my encrypted private key and ssh-agent preventing the need for me to enter my password every single save with the following.ftpconfig:The one outstanding issue I've had with this configuration is that remote-ftp fails with the following message rather than prompting for my ssh-key pass-phrase if the key is new or I haven't stored the ssh-key's passphrase in the OSX Keychain:

The solution to this is easy: Open a terminal and run
ssh hostname.domain.eduto have the terminal prompt for the pass-phrase and add the key to the running ssh-agent, but having Atom initiate the prompt would be more clear.