Unifies the chaotic ssh-agent state under Windows.
There are several different communication methods for ssh-agent in Windows, and it is very complicated to use and configure them. The following diagram shows the current communication methods for Windows ssh-agent.
OmniSSHAgent is a program to simplify what used to be a chaotic situation, as shown in the following figure.
- Windows10
- Microsoft Edge WebView2
- pageant.exe(PuTTY) shared memory
- Unix domain socket for WSL2
- NamedPipe on Windows
- Unix domain socket for WSL1
- Unix domain socket for MSYS2(Cygwin) ( #1 )
- Download
OmniSSHAgent.zip
from https://github.com/masahide/OmniSSHAgent/releases/latest, unzip it, and place it in a folder of your choice. - If you are using Windows native ssh-agent, you'll need to stop and disable it. Open powershell with administrator privileges and execute the following commands.
Stop-Service ssh-agent
Set-Service -StartupType Disabled ssh-agent
- Alternatively, you can set it through the GUI if you prefer.Bring up the start menu and type Services. You’ll see the Services app listed.
Once the Services app is open, find the
OpenSSH Authentication Agent
service and set theService Status
toStop
and theStartup Type
toDisabled
.
-
If you are using PuTTY Pageant - stop it.
-
Launch
OmniSSHAgent.exe
by double-clicking. -
Press the
Open new file
button to add a private key file. Or you can usessh-add
command or KeePassXC to add your private key.
OmniSSHAgent does not have an installer, nor registers itself to start upon boot. You'll need to do the following to register it:
- Press the Windows logo key + R, type shell:startup, then click OK. This opens the Startup folder.
- Copy and paste the shortcut to the OmniSSHAgent.exe from the file location to the Startup
Choose the instructions for your favourite shell below. If your shell isn't listed here you can convert the bash script to your shell syntax and send a PR to add it to the repo.
- Download ubuntu.setup.sh with the following command:
mkdir -p $HOME/omni-socat
curl -sL https://raw.githubusercontent.com/masahide/OmniSSHAgent/main/hack/ubuntu.setup.sh -o $HOME/omni-socat/ubuntu.setup.sh
- Add the following line to
~/.bashrc
,~/.zshrc
, or whatever file is applicable to your shell:
source $HOME/omni-socat/ubuntu.setup.sh
- Download ubuntu-fish.setup.fish with the following command:
mkdir -p $HOME/omni-socat
curl -sL https://raw.githubusercontent.com/masahide/OmniSSHAgent/main/hack/ubuntu-fish.setup.fish -o $HOME/omni-socat/ubuntu-fish.setup.fish
- Add the following line to
~/.config/fish/config.fish
:
. $HOME/omni-socat/ubuntu-fish.setup.fish
- Download rocky.setup.sh with the following command
mkdir -p $HOME/omni-socat
curl -sL https://raw.githubusercontent.com/masahide/OmniSSHAgent/main/hack/rocky.setup.sh -o $HOME/omni-socat/rocky.setup.sh
- Add the following line to
~/.bashrc
,~/.zshrc
, or whatever file is applicable to your shell:
source $HOME/omni-socat/rocky.setup.sh
Setting up Unix doman socket in ubuntu environment.
-
Check the setting of
Unix domain socket file path(WSL1):
in OmniSSHAgent. For example, if you have the following settings.. (UserName
varies depending on your environment)C:\Users\<UserName>\OmniSSHAgent.sock
The WSL1 path will be/mnt/c/Users/<UserName>/OmniSSHAgent.sock
. -
Add the following line to
~/.bashrc
export SSH_AUTH_SOCK=/mnt/c/Users/<UserName>/OmniSSHAgent.sock
-
Check the setting of
Cygwin Unix domain socket file path(MSYS2):
in OmniSSHAgent.- For example, if you have the following settings.(
UserName
varies depending on your environment). C:\Users\<UserName>\OmniSSHCygwin.sock
.- The Cygwin path will be
/mnt/c/Users/<UserName>/OmniSSHCygwin.sock
.
- For example, if you have the following settings.(
-
On the Windows taskbar, right-click the Windows icon and select System. In the Settings window, under Related Settings, click Advanced system settings.
- On the Advanced tab, click Environment Variables.
Users variables
Click onCreate new
to create a new environment variable.- Set the following values(
UserName
varies depending on your environment).
Variable name: SSH_AUTH_SOCK
Variable Value: /mnt/c/Users/<UserName>/OmniSSHAgent.sock
This is a mode using 1Password's ssh-agent function as a backend as shown in the following figure.
By setting "Enable proxy mode for 1Password key-agent" in the configuration, OmniSSHAgent becomes a Proxy that works with 1Password's ssh-agent as a backend.
When "Enable proxy mode for 1Password key-agent" is enabled, OmniSSHAgent operates as a mere proxy, and therefore, private keys cannot be added.
- PuTTY private key file (.ppk) file format
- OpenSSH format
- rsa
- ecdsa
- ed25519
(dsa, ecdsa-sk, ed25519-sk are not supported)
It's stored in Windows Credential Manager.