cagataygurturk / docker-ssh-tunnel

Simple SSH tunnel with Docker
153 stars 49 forks source link

Handling Passcodes? #6

Open NigelThorne opened 2 years ago

NigelThorne commented 2 years ago

Thank you so much for this idea. I had exactly this problem and this works great for me.

I told the rest of the team about it, and some users had issues. The problem was ... when they have a passcode on their id_rsa the service stalls. In the logs you can see it is stuck failing to get the passcode from tty.

Locally using ssh to talk to the server the users don't need to enter a passcode, so it must be in the local keychain, but not visible to the docker container.

Any thoughts on how to solve this? Cheers Nigel

cagataygurturk commented 2 years ago

Interesting problem.. I will think a solution when I have time although I am not sure how this can be done. What I can suggest at this moment is to remove the passphrase from the key. I can understand that some users do not prefer doing so though.

nsepetys commented 2 years ago

Try passing in as a env-var. This works for me: echo "${your_pass_env}" | openssl rsa -in ~/.ssh/id_rsa -passin stdin | ssh-add -