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

refactor ssh plugin #76

Merged
merged 1 commit into from
Jan 12, 2019
Merged

refactor ssh plugin #76

merged 1 commit into from
Jan 12, 2019

Conversation

chawyehsu
Copy link
Collaborator

@chawyehsu chawyehsu commented Jan 12, 2019

A total refactoring of ssh plugin, here are the changes:

  • Remove askpass (GUI prompt for key passphrase). There are several issues reported like Error on askpass.exe #24 askpass version outdated #72 , It seems that win32-openssh (the official Win32 port of OpenSSH, built-in in Windows 10) doesn't work with it. We just remove askpass and fallback to command line prompt for key passphrase and use ssh-agent cache to store the key passphrase. Trust me, ssh-agent cache is enough for you.
  • Support Win32-OpenSSH The logic has been totally rewritten to support Win32-OpenSSH. Now we will use the native ssh-agent, which runs as a system service, first if the plugin detects that there is win32-openssh installed. Thanks to posh-sshell, this work is based on its code.

And I think this should close #24 #70 #72

If you encounter some issue, please enable verbose output of this ssh plugin, in your pshazz theme json:

{
    "plugins": [ "aliases", "git", "ssh", "virtualenv", "z" ],
    "ssh": {
        "verbose": "true"    <------- enable verbose output
    }
}

@lukesampson lukesampson merged commit f40bfab into lukesampson:master Jan 12, 2019
@lukesampson
Copy link
Owner

This sounds great, thank you. Would you like to become a collaborator on this GitHub project so that you can commit directly?

@chawyehsu
Copy link
Collaborator Author

@lukesampson Yeah, I appreciate, though I want to join in the scoopinstaller org, haha.

@TCB13
Copy link

TCB13 commented Jan 12, 2019

So pshazz was supposed to also be an SSH helper that lets you never enter your private key password again now you've removed askpass. Is there anything else pshazz does related to SSH? I mean win32-openssh comes with ssh-agent working out of the box.

@chawyehsu
Copy link
Collaborator Author

chawyehsu commented Jan 13, 2019

@TCB13
The ssh plugin of pshazz does not only have the key passphrase caching feature. It does also start the ssh-agent automatically and add your keys (id_rsa) automatically, and it does also provide tab completion on ssh command.

$ ssh <TAB>
*     hostA    hostB    ...        // hosts defined in your ~/.ssh/config

askpass was just a little tool used to provide a GUI prompt to input the key passphrase and to store your key passphrase into the WCM(Windows Credential Manager).

Since Win32-OpenSSH has been able to cache your key passphrase thanks to the service running mode of ssh-agent. The ssh-agent doesn't need to interactive with askpass.

Here is the introduction about Automatically start the SSH Agent from posh-sshell, the ssh plugin of pshazz does the same thing on this feature now.

If you are using the Windows-native version of OpenSSH that ships with Windows 10 1803 or newer, then this will simply start the agent service if it's not already running and add your keys. You will be prompted once to enter your key passphrase. Once the service is running, you will not be prompted again.

If you are using the version of OpenSSH that comes with Git for Windows, then you will be prompted to enter your key the first time you open a Powershell session following a restart.

You might say, my ssh-agent starts automatically without pshazz. That's fine because you're using the win32-openssh, and the ssh-agent service is set to Automatic/Automatic (Delayed Started). If it is set to Manual, it won't start automatically, and pshazz gives help on it.

20190113085927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error on askpass.exe
4 participants