Skip to content

About

The OnlyKey agent is essentially middleware that lets you use OnlyKey as a hardware SSH/GPG device.

Resources

Stars

50 stars

Watchers

11 watching

Forks

 
 

Latest commit

 

History

500 Commits

Folders and files

Repository files navigation

onlykey-agent

Use your OnlyKey as a hardware-based SSH and GPG agent.

onlykey-agent lets you perform SSH authentication and GPG operations (signing, encryption, and decryption) using keys that are generated and stored on an OnlyKey hardware security device. Your private keys are created on the device and never leave it — they are never written to disk or exposed to your computer, which protects them from malware and key-theft even on a compromised host.

It is part of the lib-agent family of hardware agents (alongside trezor-agent, ledger_agent, keepkey_agent, and jade_agent).

Features

  • SSH agent — authenticate to servers and Git hosts with a key held on your OnlyKey.
  • GPG agent — sign emails, Git commits, and software releases, and decrypt messages.
  • age support — encrypt and decrypt files with hardware-backed keys.
  • No keys on disk — keys are generated and stored on the device and never reach the host.

Installation

pip install onlykey-agent

This installs three console entry points:

  • onlykey-agent — SSH agent
  • onlykey-gpg — GPG tool
  • onlykey-gpg-agent — GPG agent

Usage

Use your OnlyKey to log in over SSH:

onlykey-agent user@example.com -c

Set up a GPG identity backed by your OnlyKey:

onlykey-gpg init "Your Name <you@example.com>"

Derived keys default to the original derivation, so existing SSH and GPG keys are unchanged. --skey derived-v2 / --dkey derived-v2 selects the newer HKDF-based derivation (firmware v3.1.0+), which gives different keys.

Full SSH and GPG instructions, including common use cases, are available in the project documentation.

Requirements

  • Python 3.10+
  • An OnlyKey device (composite PQC GPG keys and --skey/--dkey derived-v2 need firmware v3.1.0 or newer)
  • lib-agent and the onlykey Python package (installed automatically)

Links

License

Released under the GNU Lesser General Public License v3 (LGPLv3).

About

The OnlyKey agent is essentially middleware that lets you use OnlyKey as a hardware SSH/GPG device.

Resources

Stars

50 stars

Watchers

11 watching

Forks

Releases

Packages

Used by

Contributors

Languages