facebookarchive / nuclide

An open IDE for web and native mobile development, built on top of Atom
https://nuclide.io
Other
7.79k stars 682 forks source link

SSH problems using either Pageant or private key with passphrase #1488

Open theFuzzyWebDev opened 6 years ago

theFuzzyWebDev commented 6 years ago

Issue and Steps to Reproduce

Cannot connect to my dev box with:

Expected Behavior

I expected that in both Case A & B I would connect just as it does when using a non passworded private key, being that it's a confirmed working ssh connection since I am able open an ssh session via Putty with the key file and with +Pageant using both the non passworded and passworded files.

I'm just not sure if I should be expecting a prompt when using the Private Key File option or if this isn't supported at all.

Actual Behavior

🙀 Kittens are dying left and right. 🙀 Seriously, in Case A; It asked if I'm sure I want to use ssh agent option or something like that. I sifted through the source for the socket handler, referencing an older related GitHub Post I found and even tried adding 'SSH_AUTH_SOCK' with the value of "pageant" to the WIndow's User environment variables to see if it would pass into the Atom/Nuclide's node process.env check; thinking it be somehow related...

Adding the environment variable just gets rid of the immediate error notification but the busy spinner just does it's spinning thing, while another kitten dies of dizziness watching and waiting. 😿

While, in Case B, it fails and says I get this error: "Can't read content of private key path C:\Users\Me.ssh\fwd_Private.ppk." ==> "...Encrypted private key detected, but no passphrase given"

Versions

Additional Details

Should this be working or am I out of luck here?

theFuzzyWebDev commented 6 years ago

I think I've solved my issue! I am now able to get Nuclide connected to my server again.

In the process I ended up doing away with Putty/Pageant and moving to Git Bash/ssh-agent, Issue #625 pointed me in the right direction.

I finally edited my .bashrc as well with:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

# script exits after lines below if mode noninteractive
[ -z "$PS1" ] && return

I'd had both blocks in there to begin with but the NVM block was added to the bottom by default on install and the 'script exits' block has been at the beginning. Moving the NVM block above it was the final key piece it seems.

paulchill commented 6 years ago

I cannot connect at all to Nuclide on a linux VM using my windows machine.

I tried using a key with and without a password, tried ssh agent + pagenant

noting connects, i'm using putty right beside it and connects easily with the same settings.

Any ideas?

theFuzzyWebDev commented 6 years ago

@paulchill : Is Nuclide timing out on the connection or does it automatically throw an error when you try to connect? EIther way, what's the error say?

paulchill commented 6 years ago

We are using a keyfile with no password is loading continuously.

Then if we use the -k flag we get the project showing in the tree but with constant errors every few seconds and we can't open the tree or view the files.

I am on: Windows ten Latest version of atom Nuclide 0.293 on the client and the Ubuntu server with watchman + python installed.

Here is the error:

Error: Not connected at Client.forwardOut (C:\Users\crist.atom\packages\nuclide\node_modules\ssh2\lib\client.js:983:11) at SshHandshake._forwardSocket (C:\Users\crist.atom\packages\nuclide\pkg\nuclide-remote-connection\lib\SshHandshake.js:275:22) at Server. (C:\Users\crist.atom\packages\nuclide\pkg\nuclide-remote-connection\lib\SshHandshake.js:467:18) at emitOne (events.js:96:13) at Server.emit (events.js:191:7) at TCP.onconnection (net.js:1486:8)