Coder Social home page Coder Social logo

ssh-agent-helper's Introduction

SSH Agent Helper

Use SSH keys from CMD, PowerShell, etc. on Windows

What does it fix?

If you want to use ssh with SSH keys (or git authenticated via SSH keys) from Command Prompt (cmd) or PowerShell, you either have to use startup scripts for the terminals or set the ssh-agent variables manually on each instance. This program just simply make ssh-agent universally available to programs launched from Windows environment. Which means that you can use do ssh-add to add keys that will be available in all terminals. And use your precious ssh and git right from Command Prompt, PowerShell, Bash or any other.

Usage

Download the binary from latest release.

  • ssh-agent-helper.exe: Invoking the program without any parameters will result in running ssh-agent and setting SSH_AUTH_SOCK and SSH_AGENT_PID as current user's environment variables. This will allow ssh-add, ssh or any other programs that consume ssh-agent to conect to it without any further configuration. But you must restart Command Prompt or PowerShell after this to take effect.
  • ssh-agent-helper.exe with --register-startup or -r parameter configures ssh-agent to run at the time of Windows startup.
  • ssh-agent-helper.exe with -r -a (path for (multiple) id_rsa here) configures ssh-agent to run at Windows startup and add specified SSH keys to the agent. E.g.ssh-agent-helper.exe -r -a %USERPROFILE%\.ssh\id_rsa
  • ssh-agent-helper.exe with --unregister-startup or -u will disable run at Windows startup functionality.

You can get the usage information by invoking the program with --help switch.

How can I contribute?

Try to use use and report bugs if you face any. Suggest any ideas you think can make this project better.

License

This project is covered by MIT License and the LICENSE file is included with the source code.

ssh-agent-helper's People

Contributors

raeesbhatti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ssh-agent-helper's Issues

/add Does Not Support Passphrase

I'm not sure if it will be possible to do so securely, but it would be ideal if we could prompt the user for their passphrase and pass that along to ssh-add. As it is, the user sees the ssh-add prompt, but the program doesn't wait for input. It appears to just exit. Perhaps ssh-add detects that it's not connected to the console. I'm not sure. I haven't looked further into it. You can still use ssh-agent-helper with a passphrase, but can't use the /add switch. You just have to invoke ssh-add yourself after (i.e., register startup with no arguments if desired).

Update Readme to indicate git bash installation requirement

I believe that I figured this out by looking through the "issues" but it might be useful to update the readme to indicate that you need to check the NON-DEFAULT option Use Git and optional Unix tools from the Windows Command Prompt. It does indicate in the installation to not check that unless you understand the implications (not sure I do) of a couple typical dos utilities (find and sort) being overridden by the gnu utilities of the same name.
git-install-option

Health Check / Duplicate Process

I wonder if ssh-agent-helper should be checking for an existing process via the environment, and starting a new one if it cannot find one. For example, ssh-agent normally puts its PID into the SSH_AGENT_PID variable. It might be possible to check for the existence of that process and start a new one, overwriting the variables if it doesn't exist. It might be possible to ALWAYS do this. Similarly, before starting a new process, it would be ideal to check for an existing one running and skip starting a new one if one is already running (and the environment is already setup for it). Giving the user the ability to kill extraneous processes might also be useful (e.g., ssh-agent is already running, but it's PID doesn't match the environment; would you like to try to kill it?). Just thoughts...

Usage / Switch Parsing Appears Inconsistent

The program appears to require /startup in addition to /add for the agent to be started prior to running ssh-add, but the usage does not make this clear. I suggest refactoring the program into two steps: first loop over the arguments, one-by-one, parsing switches and storing the state of what the user wants to do in variables (e.g., add=true, keys=new List{ "C:\blah\id_rsa.pub" }, register_startup=true, unregister_startup=false, etc.).

Once arguments have been processed and what to do is stored conveniently then we can do it a single time instead of repeating calls (e.g., to addKeys()). Hopefully that will make processing the arguments more clear and will simplify the program.

The usage could also be updated if necessary to ensure it's clear and correct.

WS.Reputation.1

When used in a corporate environment, on a computer encumbered with Symantec Endpoint Protection, we get an error as Symantec blocks the execution with WS.Reputation.1. This effectively means that its not a "known" executable. I recommend asking Symantec to white list your application.

https://support.symantec.com/en_US/article.TECH132220.html

I would think it should be fairly easy to get approved since the source is available.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.