βœ“
Opkssh Download

Passwordless SSH authentication tool using OpenID Connect identities instead of SSH keys, generating time-limited certificates with ID Tokens from Google, Microsoft, GitLab, and custom OIDC providers for cross-platform server access.

⭐ 1,775 stars on GitHub
Latest Release: v0.10.0

About Software

Opkssh (OpenPubkey SSH) enables SSH to use OpenID Connect for authentication, replacing long-lived SSH keys with email-based identities and ID Tokens. It builds on the OpenPubkey protocol, generating SSH public keys that contain PK Tokens with standard OIDC ID Tokens, compatible with Google, Microsoft, GitLab, and other providers. Users run `opkssh login` to authenticate via browser and generate time-limited SSH keys.

Server administrators install opkssh and configure sshd to verify OIDC identities using the AuthorizedKeysCommand option. Access control supports individual users ([email protected]), groups (oidc:groups:ssh-users), and custom claims for fine-grained policy enforcement. Cross-platform support includes Windows, macOS, and Linux with Homebrew, Winget, Chocolatey, and Nix installation options.

Use Cases:

  • Passwordless SSH authentication using OpenID Connect identities like [email protected] instead of long-lived SSH keys
  • Manage SSH server access via Google, Microsoft Azure, GitLab, or custom OIDC providers with user emails and group policies
  • Generate time-limited SSH certificates (24-hour expiry) containing ID Tokens for enhanced security
  • Configure SFTP and SSH tunnels with OIDC-based authentication without modifying existing SSH infrastructure

Downloads

v0.10.0 September 11, 2025
opkssh-windows-amd64.exeexe
opkssh_0.10.0_linux_amd64.apkapk
opkssh_0.10.0_linux_amd64.debdeb
opkssh_0.10.0_linux_arm64.apkapk
opkssh_0.10.0_linux_arm64.debdeb
v0.9.0 August 24, 2025
opkssh-windows-amd64.exeexe
opkssh_0.9.0_linux_amd64.apkapk
opkssh_0.9.0_linux_amd64.debdeb
opkssh_0.9.0_linux_arm64.apkapk
opkssh_0.9.0_linux_arm64.debdeb
v0.8.0 July 17, 2025
opkssh-windows-amd64.exeexe
opkssh_0.8.0_linux_amd64.apkapk
opkssh_0.8.0_linux_amd64.debdeb
opkssh_0.8.0_linux_arm64.apkapk
opkssh_0.8.0_linux_arm64.debdeb
v0.7.0 May 27, 2025
opkssh-windows-amd64.exeexe
opkssh_0.7.0_linux_amd64.apkapk
opkssh_0.7.0_linux_amd64.debdeb
opkssh_0.7.0_linux_arm64.apkapk
opkssh_0.7.0_linux_arm64.debdeb
v0.6.1 May 03, 2025
opkssh-windows-amd64.exeexe
opkssh_0.6.1_linux_amd64.apkapk
opkssh_0.6.1_linux_amd64.debdeb
opkssh_0.6.1_linux_arm64.apkapk
opkssh_0.6.1_linux_arm64.debdeb
v0.6.0 April 30, 2025
opkssh-windows-amd64.exeexe
opkssh_0.6.0_linux_amd64.apkapk
opkssh_0.6.0_linux_amd64.debdeb
opkssh_0.6.0_linux_arm64.apkapk
opkssh_0.6.0_linux_arm64.debdeb
v0.5.1 April 16, 2025
opkssh-windows-amd64.exeexe
opkssh_0.5.1_linux_amd64.apkapk
opkssh_0.5.1_linux_amd64.debdeb
opkssh_0.5.1_linux_arm64.apkapk
opkssh_0.5.1_linux_arm64.debdeb
v0.4.0 April 01, 2025
opkssh-windows-amd64.exeexe
v0.3.0 March 23, 2025
opkssh-windows-amd64.exeexe
v0.2.2 March 17, 2025
opkssh-windows-amd64.exeexe
v0.2.1 March 16, 2025
opkssh-windows-amd64.exeexe

Package Info

Last Updated
Sep 11, 2025
Latest Version
v0.10.0
License
Apache-2.0
Total Versions
11

README

opkssh (OpenPubkey SSH)

Go Coverage (https://github.com/openpubkey/opkssh/wiki/coverage.svg)

opkssh is a tool which enables ssh to be used with OpenID Connect allowing SSH access to be managed via identities like [email protected] instead of long-lived SSH keys. It does not replace SSH, but instead generates SSH public keys containing PK Tokens and configures sshd to verify them. These PK Tokens contain standard OpenID Connect ID Tokens (https://openid.net/specs/openid-connect-core-1_0.html). This protocol builds on the OpenPubkey (https://github.com/openpubkey/openpubkey/blob/main/README.md) which adds user public keys to OpenID Connect without breaking compatibility with existing OpenID Provider.

Currently opkssh is compatible with Google, Microsoft/Azure, Gitlab, hello.dev, and Authelia OpenID Providers (OP). See below for the entire list. If you have a gmail, microsoft or a gitlab account you can ssh with that account.

To ssh with opkssh you first need to download the opkssh binary and then run:

opkssh login

This opens a browser window where you can authenticate to your OpenID Provider. This will generate an SSH key in ~/.ssh/id_ecdsa which contains your OpenID Connect identity. Then you can ssh under this identity to any ssh server which is configured to use opkssh to authenticate users using their OpenID Connect identities.

ssh [email protected]

OpenPubkey Mailing List

For updates and announcements join the OpenPubkey mailing list. (https://groups.google.com/g/openpubkey)

Getting Started

To ssh with opkssh, Alice first needs to install opkssh using homebrew or manually downloading the binary.

Homebrew Install (macOS)

To install with homebrew run:

brew tap openpubkey/opkssh
brew install opkssh

Winget Install (Windows)

To install with winget run:

winget install openpubkey.opkssh

Chocolatey Install (Windows)

To install with Chocolatey (https://chocolatey.org/install) run:

choco install opkssh -y

Nix Install

Use the opkssh nixpkg (https://search.nixos.org/packages?channel=unstable&show=opkssh&query=opkssh) as normal, or test it via:

nix-shell -p opkssh

Manual Install (Windows, Linux, macOS)

To install manually, download the opkssh binary and run it:

Download URL
🐧 Linux (x86_64) github.com/openpubkey/opkssh/releases/latest/download/opkssh-linux-amd64 (https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-linux-amd64)
🐧 Linux (ARM64/aarch64) github.com/openpubkey/opkssh/releases/latest/download/opkssh-linux-arm64 (https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-linux-arm64)
🍎 macOS (x86_64) github.com/openpubkey/opkssh/releases/latest/download/opkssh-osx-amd64 (https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-osx-amd64)
🍎 macOS (ARM64/aarch64) github.com/openpubkey/opkssh/releases/latest/download/opkssh-osx-arm64 (https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-osx-arm64)
⊞ Win github.com/openpubkey/opkssh/releases/latest/download/opkssh-windows-amd64.exe (https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-windows-amd64.exe)

To install on Windows run:

curl https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-windows-amd64.exe -o opkssh.exe

To install on macOS run:

curl -L https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-osx-amd64 -o opkssh; chmod +x opkssh

To install on linux, run:

curl -L https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-linux-amd64 -o opkssh; chmod +x opkssh

or for ARM

curl -L https://github.com/openpubkey/opkssh/releases/latest/download/opkssh-linux-arm64 -o opkssh; chmod +x opkssh

SSHing with opkssh

After downloading opkssh run:

opkssh login

This opens a browser window to select which OpenID Provider you want to authenticate against. After successfully authenticating opkssh generates an SSH public key in ~/.ssh/id_ecdsa which contains your PK Token. By default this ssh key expires after 24 hours and you must run opkssh login to generate a new ssh key.

Since your PK Token has been saved as an SSH key you can SSH as normal:

ssh [email protected]

This works because SSH sends the public key written by opkssh in ~/.ssh/id_ecdsa to the server and sshd running on the server will send the public key to the opkssh command to verify. This also works for other protocols that build on ssh like sftp (https://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol) or ssh tunnels.

sftp [email protected]

Custom key name

Instructions

SSH command

Tell opkssh to store the name the key-pair opkssh_server_group1

opkssh login -i opkssh_server_group1

Tell ssh to use the generated key pair.

ssh -o "IdentitiesOnly=yes" -i ~/.ssh/opkssh_server_group1 [email protected]

We recommend specifying -o "IdentitiesOnly=yes" as it tells ssh to only use the provided key. Otherwise ssh will cycle through other keys in ~/.ssh first and may not get to the specified ones. Servers are configured to only allow 6 attempts by default the config key is MaxAuthTries 6.

Installing on a Server

To configure a linux server to use opkssh simply run (with root level privileges):

wget -qO- "https://raw.githubusercontent.com/openpubkey/opkssh/main/scripts/install-linux.sh" | sudo bash

This downloads the opkssh binary, installs it as /usr/local/bin/opkssh, and then configures ssh to use opkssh as an additional authentication mechanism.

To allow a user, [email protected], to ssh to your server as root, run:

sudo opkssh add root [email protected] google

To allow a group, ssh-users, to ssh to your server as root, run:

sudo opkssh add root oidc:groups:ssh-users google

We can also enforce policy on custom claims. For instance to require that root access is only granted to users whose ID Token has a claim https://acme.com/groups with the value ssh-users run:

sudo opkssh add root oidc:\"https://acme.com/groups\":ssh-users google

which will add that line to your OPKSSH policy file.

How it works

We use two features of SSH to make this work. First we leverage the fact that SSH public keys can be SSH certificates and SSH Certificates support arbitrary extensions. This allows us to smuggle your PK Token, which includes your ID Token, into the SSH authentication protocol via an extension field of the SSH certificate. Second, we use the AuthorizedKeysCommand configuration option in sshd_config (see sshd_config manpage (https://man.openbsd.org/sshd_config.5#AuthorizedKeysCommand)) so that the SSH server will send the SSH certificate to an installed program that knows how to verify PK Tokens.

What is supported

Client support

OS Supported Tested Version Tested
Linux βœ… βœ… Ubuntu 24.04.1 LTS
macOS βœ… βœ… macOS 15.3.2 (Sequoia)
Windows11 βœ… βœ… Windows 11