rgzr / sshtun

Go package to create SSH tunnels
MIT License
86 stars 12 forks source link

add authentication based on SSH agent #5

Closed uykusuz closed 5 years ago

uykusuz commented 5 years ago

This change adds a third authentication method, ssh-agent, to the list of authentication options. It will try to retrieve the list of signers based on the SSH_AUTH_SOCK environment variable and setup an authentication method based on the first encountered signer in that list.

Also it adds the option to let the tunnel guess the authentication method automatically. In that case it will try to retrieve a method from a key file and if that fails through the ssh-agent.

rgzr commented 5 years ago

Hey, thank you! This looks nice! :)

I will review it in the next days and merge it.

rgzr commented 5 years ago

I merged it and made some modifications later in https://github.com/rgzr/sshtun/commit/a519f41c835102d22ae14166bb9d29ca28ce7e9a to allow encrypted key file auth. Thank you!

SwenChan commented 5 years ago

Bravo! It's been a long time.

uykusuz commented 5 years ago

cool, I'm glad it found the way in :)