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

SSH with public key not working #93

Closed
nrbrook opened this issue Oct 2, 2013 · 12 comments
Closed

SSH with public key not working #93

nrbrook opened this issue Oct 2, 2013 · 12 comments

Comments

@nrbrook
Copy link

nrbrook commented Oct 2, 2013

Even if I specify the public key to use, MongoHub gives a "Wrong password" error.

If I look in the console I see:

02/10/2013 11:26:46.379 MongoHub[27151]: /usr/bin/ssh -L 40005:localhost:27017 -v -N -o ConnectTimeout=28 -o NumberOfPasswordPrompts=1 -o ConnectionAttempts=1 -o ExitOnForwardFailure=yes -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o TCPKeepAlive=yes -C -p 1234 -l nick redacted.website -i /Users/nick/.ssh/id_rsa.pub

02/10/2013 11:26:47.033 MongoHub[27151]: SSH TUNNEL ERROR: Error Domain=MHTunnelDomain Code=6 "Wrong password" UserInfo=0x108746660 {NSLocalizedDescription=Wrong password}

If I run the command it logged directly in terminal it does open the tunnel and then I can connect to Mongo on localhost:40005

@nrbrook
Copy link
Author

nrbrook commented Oct 3, 2013

I traced this down to the private key having a passphrase. Removing the passphrase with ssh-keygen -p allows MongoHub to connect.

@nrbrook
Copy link
Author

nrbrook commented Oct 10, 2013

Mongohub should instead prompt the user for the passphrase or...however it is doing it currently...isn't using ssh-agent to provide the passphrase

@jeromelebel
Copy link
Owner

Thanks for finding about the passphrase. I looked into that problem. I can reproduce it, but I have no clue how to fix it. One work around is to create a second ssh key without a passphrase. But I guess you already think about that, and you won't like it...
So unfortunately, I don't think I will be able to fix it anytime soon.

@jeromelebel
Copy link
Owner

I think I didn't test it correctly. Did you try to put your passphrase into the password field in MongoHub? It seems to work for me.

@nrbrook
Copy link
Author

nrbrook commented Oct 19, 2013

Ah yeah that seems to work, maybe just make it clearer that the box can be used for password and SSH key passphrase... thanks

@nrbrook nrbrook closed this as completed Oct 19, 2013
@jeromelebel
Copy link
Owner

It would be nice to use the ssh-agent though (if there is no password in the UI)... But I don't understand why it is not used when mongohub launch the ssh process.

@nrbrook
Copy link
Author

nrbrook commented Oct 19, 2013

Me neither! This really confused us in the office...

@jeromelebel
Copy link
Owner

I found the way to use the ssh-agent when mongohub starts the ssh process. This bug will be fixed exactly the way it is supposed to be in the next update (you won't need to enter the passphrase in mongohub).

[master fa5cd58] don't try to give a password if the user didn't provide any, and we need to use the ssh-agent #93

@nrbrook
Copy link
Author

nrbrook commented Oct 19, 2013

nice, well done!

@jeromelebel
Copy link
Owner

Thanks for your help, it would have been a nightmare to find why it was not working for you!

@jeromelebel
Copy link
Owner

Fixed in 2.5.14, I let you close this issue after testing this new release.

@jeromelebel
Copy link
Owner

(oups, already closed)

pkasperski pushed a commit to pkasperski/MongoHub-Mac that referenced this issue Dec 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants