Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unexpected packet before version" using private key authentication #185

Closed
jradwan opened this issue Mar 13, 2020 · 2 comments
Closed

"Unexpected packet before version" using private key authentication #185

jradwan opened this issue Mar 13, 2020 · 2 comments
Labels
bug Something isn't working waiting Waiting for confirmation, more information, ...

Comments

@jradwan
Copy link

jradwan commented Mar 13, 2020

When trying to connect to an SSH file system using a private key for authentication, I get this error from the extension:

Error while connecting to SSH FS <server name>: Unexpected packet before version

I've tried all the different combinations:

  • using the PuTTY/Pageant config
  • setting the location of the .ppk file and prompting for the passphrase
  • setting the location of the .ppk file and saving the passphrase in the extension settings

On the same server I have a second login with normal username/password authentication and that works fine with the extension. It just seems to be when trying to use the private key.

@SchoofsKelvin
Copy link
Owner

Might this be a similar issue to mscdex/ssh2-streams#121?

If it's a protocol issue, it's probably a bug in the libraries I use (ssh2 which in turn uses ssh2-streams) or a configuration/setup issue with your SSH server. Might also be related to #162 or #36, although this exact error message is unexpected.

@SchoofsKelvin SchoofsKelvin added bug Something isn't working waiting Waiting for confirmation, more information, ... labels Mar 19, 2020
@jradwan
Copy link
Author

jradwan commented Mar 19, 2020

I figured it out. Turns out I wasn't just having this problem in VSCode but in any sFTP client using my private key. The culprit turned out to be an environment script that was added to my .bashrc. The new script was generating output when executed, displayed to stdout. This was breaking the sFTP negotiation (I guess sFTP runs login scripts like a regular SSH connection). I edited .bashrc to send that script's output to /dev/null and the connection works now. Sorry for the false alarm. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting Waiting for confirmation, more information, ...
Projects
None yet
Development

No branches or pull requests

2 participants