Sublime Forum

Invalid SSH key passphrase specified

#1

Whenever I manually sync a folder that contains subfolders from local to remote (via: Sidebar > right click > Sync Local -> Remote) I get the following error:

  File "\\?\C:\Users\will\AppData\Roaming\Sublime Text\Packages\SFTP\sftp\threads.py", line 22, in run_with_except_hook
  File "\\?\C:\Users\will\AppData\Roaming\Sublime Text\Packages\SFTP\sftp\file_transfer.py", line 71, in run
  File "\\?\C:\Users\will\AppData\Roaming\Sublime Text\Packages\SFTP\sftp\file_transfer.py", line 209, in clone
  File "\\?\C:\Users\will\AppData\Roaming\Sublime Text\Packages\SFTP\sftp\sftp_transport.py", line 286, in connect
  File "\\?\C:\Users\will\AppData\Roaming\Sublime Text\Packages\SFTP\sftp\sftp_transport.py", line 263, in connect
SFTP.sftp.errors.AuthenticationError: Invalid SSH key passphrase specified

The SSH passphrase is correct, though. Everything SFTP related works perfectly fine except for this error message. I’ve experienced this with both ST3 and ST4.

Anyone else having this issue?
Thanks, Stefan

0 Likes

#2

I’ve updated my post, since the error message was missing.

0 Likes

#3

The \\?\ path prefixes look suspicious to me.

It can be prepended to enable python to handle long paths (>260 chars) on Windows, but passing those path strings as command line arguments will most likely fail.

I wouldn’t expect those prefixes in tracebacks however.

0 Likes

#4

Thanks for bringing that up! The paths don’t even exist on my machine. I haven’t got a “will” user folder and also no “Sublime Text”, but “Sublime Text 3”, since I’ve upgraded from version 3 to 4 (but the error also occurs with version 3).

0 Likes

#5

I believe what you’re seeing there is the debug information embedded in the compiled package modules, so the path has Will’s folder structure from the point at which the code was compiled.

I don’t think that’s contributing to your problem; possibly this is related to the new version of SFTP shipping with new tools that perhaps don’t work the same as they used to?

0 Likes

#6

Thanks!

It’s not caused by the new SFTP version. I had seen the error before and temporarily dealt with it by commenting out the code that handles the error output inside SFTP.py.

The update to the new version overwrote my “fix” and brought the error to daylight again.

0 Likes

#7

How did you make the change? If you modify the sublime-package file directly, your change will get clobbered away whenever the package updates.

The OverrideAudit package (of which I am the author) makes it easier for you to make the change in a safer way and get warned on upgrades so that you can make sure that you get all bug fixes while keeping your modifications intact.

0 Likes

#8

Thank you for the suggestion.

I had completely disabled error message outputs by commenting out lines 312 to 322 of SFTP.py.

Since this is obviously a very bad long term solution, I didn’t mind it getting overwritten by a (rare) package update. But anyway, it’s good to know about your plugin.

Can you think of a way to just suppress this specific error message? As long as the syncing works (and it does), I wouldn’t care too much, if the root cause remained unknown.

0 Likes

#9

Off the top of my head (and it sounds disingenuous), but I would say either setting the correct passphrase key or, if it is correct and it’s still complaining and it’s not a config issue, raise an issue for the package because there may possibly be a defect there in the code that’s causing the issue.

0 Likes

#10

Thank you again!

I think, I can rule out an issue with my key files after trying different formats and because they actually work (everywhere including Sublime SFTP).

Best wishes!

0 Likes

#11

In case someone else is having the same problem:

Removing and reinstalling the Sublime SFTP package only resolves the issue until Sublime Text gets closed and reopened. To get rid of the error popup/message without turning off other error popups and messages, I did the following.

Find this line within SFTP.py (currently at line 300):

if message.find('/sftp/') != -1 or message.find('\\sftp\\') != -1:

Replace with:

if message.find('Invalid SSH key passphrase specified') == -1 and (message.find('/sftp/') != -1 or message.find('\\sftp\\') != -1):

0 Likes

#12

If you are on Windows, what key format are you using? SFTP on windows uses PuTTY’s psftp.exe, so your SSH key should be a .ppk. If you are trying to use an OpenSSH key, that may be the issue.

Provide some details and we can go from there.

0 Likes

#13

Thanks for getting involved!

The keys I use with Sublime are all .ppk. I convert them from OpenSSH using FileZilla. My keys mostly look like this (some are shorter):

PuTTY-User-Key-File-2: ssh-rsa
Encryption: aes256-cbc
Comment: imported-openssh-key
Public-Lines: 12
AAAAB3NzaC1yc2EAAAADAQABAAABgQC34oL8LvEN36E1YHqYsmAu3+icebU+CYSa
z/VrNWIqHgPW8Z4/Wr8vtXWORS7PJ+mNGUe7vAZMk+L9FZXbIvunLeMz5/0cBY6o
eK72NwZPeH7Cg/VBw9s6Qc69YmBV0Iy8wWkT4lpVS9Un60p5VmCoq2SdqCRT0uF5
/q0skSrsbu3mFh9XBbPQlGACXhdYbYj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B6VZTPD1EnU/gF4/5kXbnxiR/M7LIf++zxnrs5oaJUhFy4MXKM6XMlV
tM9ftrs6Z98EkAnWdgoSJiKu21E8KXCKU/bdkU9ZSCf4w9TeEDqeCXUxVJqCFJBG
EvLD+PiemYihXzDg6r/G/g==
Private-MAC: dc95222d47f44fe53c975505ddcba550e8ff3156

My key files are mostly located on a virtual drive, added to sftp-config.json like this:

"ssh_key_file": "S:\\ssh\\some-file-name.ppk"

I’ve tried different passphrases, in case certain characters (e.g. spaces) weren’t allowed, but it didn’t make a difference.

All SFTP functionality works perfectly fine. It’s only about the mentioned error, every time I sync folders that contain multiple subfolders.

0 Likes