Skip to content

Repository files navigation

SSH-X - A collection of SSH utilities

About

SSH-X is a collection of utilities around OpenSSH

List

Installation

HomeBrew

You can install ssh-x with homebrew

brew install --HEAD gerardnico/tap/sshx

If you can't load a bash-lib library file, be sure to have the variable SSH_BASHLIB_LIBRARY_PATH set with the directory of the bash-lib installation directory.

WSL Git IDE and SSH Agent integration

Because this library uses the linux ssh-agent (ie wsl), it's not possible to pass the ssh-agent env (ie process id) directly with WSLENV. Git therefore does not know that there is an agent running.

The solution is to:

  • create a git wrapper at /usr/local/sbin/git
  • set this git executable as your git executable in your IDE

Example:

#!/usr/bin/env bash

# Load ssh-agent env
SSH_X_AGENT_ENV=$HOME/.ssh/ssh-x-agent.env
if [ -f "$SSH_X_AGENT_ENV" ]; then
  source "$SSH_X_AGENT_ENV" >| /dev/null
fi

# Other SSH_X_ENV or source your env file.
export SSH_X_KEY_STORE="pass"

# Then git
/usr/bin/git "$@"

Test from a Windows terminal

wsl --cd /path/to/a/git/repo git fetch origin

Example of a console git fetch with IntelliJ and pass as a private key store

19:30:39.727: [touch] /usr/local/sbin/git -c credential.helper= -c core.quotepath=false -c log.showSignature=false fetch origin --recurse-submodules=no --progress --prune

Output:

ssh-x-auth-proxy-command::main#71: Private Key is not in agent
ssh-x-auth-proxy-command::main#91: Adding Pass Private Key (ssh-x/id_git_github.com) to agent for a lifetime of 15m seconds
Identity added: /dev/fd/63 (email@email.com)
Lifetime set to 900 seconds

WSL IDE and Pass integration

If you use pass as a private key store, you need to install a pgp gui pinentry.

Example with pinentry-qt.

sudo apt -y install pinentry-qt

Support

Caller log: SSH_X_CALLERS_LOG

You can set the env SSH_X_CALLERS_LOG to a directory and ssh-x will create a log file each time the ssh:add function is called showing a prompt.

Permission denied (publickey)

If you get this error from your IDE, this is because Git does not know your agent. See WSL GIT IDE Integration

About

SSH Command Plugin/Extension

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages