Skip to main content

authkeyman

A simple command-line tool to make managing your ~/.ssh/authorized_keys file easier.

Features

  • Add keys to your authorized_keys file.
  • Remove keys from your authorized_keys file by key comment.
  • Add and remove keys from other users when running as root.

Install

If you don't need to manage other users' authorized_keys files, then simply install with pipx:

pipx install authkeyman

Otherwise, install the tool system-wide by running this command:

curl -L https://raw.githubusercontent.com/TacticalLaptopBag/authkeyman/refs/heads/main/curl-install.sh | sudo bash

Uninstall

If you installed with pipx, simply use that to uninstall:

pipx uninstall authkeyman

If you installed using the curl-install.sh script, use this command:

curl -L https://raw.githubusercontent.com/TacticalLaptopBag/authkeyman/refs/heads/main/curl-uninstall.sh | sudo bash

Usage

Add Keys

Add keys to the authorized_keys file:

authkeyman add "ssh-ed25519 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX your-key-name"

Note that the key is wrapped in quotes.

You can also add multiple keys at once by stringing them together:

authkeyman add "ssh-ed25519 ... key1" "ssh-ed25519 ... key2" ...

Remove Keys

Remove keys from the authorized_keys file by using its comment:

authkeyman remove your-key-name

You can remove multiple keys at once:

authkeyman remove key1 key2

You can also use partial comments and authkeyman will prompt you if the matching key is the one you want to remove:

authkeyman remove key-name
No keys found commented with 'key-name', but a similar key was found:
your-key-name

Would you like to use this one instead? (y/N):

If multiple keys match, it will ask you to make a decision:

authkeyman remove key
No keys found commented with 'key', but these similar keys were found:
[0]: key1
[1]: key2

Which one would you like to use instead? (Default 0, make a selection 0-1): 

Running this command with -y will skip the prompt and remove the key. If multiple keys match, it will delete the first key that matches.

List Keys

Lists all key comments in the authorized_keys file:

authkeyman list
Keys in /home/user/.ssh/authorized_keys:
key1
key2

Perform Actions on Other Users

You can run all of these commands on other users when running authkeyman as root and specifying the --user flag:

sudo authkeyman --user user1 add "ssh-ed25519 ... user1s-key"

You can add additional --user flags to specify multiple users:

sudo authkeyman --user user1 --user user2 add "ssh-ed25519 ... users-key"

Note that the --user flags must come directly after authkeyman and cannot come after a subcommand.

Metadata

Release files for authkeyman 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for authkeyman 1.1.1
File Size Uploaded Provenance
authkeyman-1.1.1.tar.gz 16.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for authkeyman 1.1.1
File Interpreter ABI Platform
authkeyman-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 34.5 kB

Release files / authkeyman-1.1.1.tar.gz

Download URL authkeyman-1.1.1.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d51573da0afd754a18b846e42f64f192e4f59f8c1332a8d1acf9c7a9f3b8a7e5
BLAKE2b-256 checksum
How to use checksums
0ffafd689900595c14cb6322604e1496d6aae63443cab366648ba3eb2dbb7080
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.7 Linux/6.11.0-29-generic

Release files / authkeyman-1.1.1-py3-none-any.whl

Download URL authkeyman-1.1.1-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78d65d771d1c75de0b54529366fb89113bd409964b2dd481f011133bf651b1f9
BLAKE2b-256 checksum
How to use checksums
ac2dd59ba34041e49883262d28f020d0a5be8eba3d9c219bc51c4f528db0260b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.12.7 Linux/6.11.0-29-generic

Security for authkeyman 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page