Registry / auth-security / ssh-import-id

ssh-import-id

JSON →
library5.13pypypi✓ verified 85d ago

Authorize SSH public keys from trusted online identities (GitHub, GitLab, Launchpad, etc.). Current version 5.13, with stable release cadence since 2019. Integrated into Ubuntu/Canonical Cloud images for key management.

pip install ssh-import-id
INSTALL
IMPORT
SIG · SSH-IMPORT-ID
S
ssh-import-id
auth-securitypythonv5.13
Install
1.7s avg
Import
132ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.13 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.134s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.130s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ssh-import-id CLI
from ssh_import_id import main
from ssh-import-id import ...
Use underscores instead of hyphens in Python imports.
ssh-import-id-gh
from ssh_import_id.gh import main
from ssh-import-id-gh import ...
Scripts are not Python names; use the module path with underscore.

Quickstart: authorize keys from GitHub user 'cmars' using subprocess or the Python module. The CLI is the primary interface.

import subprocess import os # Fetch and add keys from GitHub user 'cmars' subprocess.run(['ssh-import-id', 'gh:cmars'], check=True) # Or run from Python with module from ssh_import_id import main try: main(['gh:cmars']) except SystemExit as e: print(f'Exited with code {e.code}')
ssh-import-id --version
Debug
Known issues
gotchaThe Python module (ssh_import_id) is intended for use as a library but the primary interface is the CLI. Calling main() directly may raise SystemExit on non-zero exit.
fix
Use subprocess.run(['ssh-import-id', ...]) for production scripts; wrap main() call in try/except SystemExit if using the library.
affects: all
gotchassh-import-id requires the target user to have a home directory and ~/.ssh/authorized_keys file. May fail silently if not present.
fix
Ensure the user exists and has proper directory permissions. Run as the target user or use sudo -u.
affects: all
deprecatedThe --auto option (automatic retry) and --erase (remove keys from other sources) have been deprecated in version 5.10+.
fix
Use --retry N for retries; use --remove to delete keys from specific sources.
affects: >=5.10
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'ssh_import_id'
ssh-import-id is not installed or imported with wrong name (hyphen instead of underscore).
fix
Install: pip install ssh-import-id. Import: from ssh_import_id import main.
ssh-import-id: error: unrecognized arguments: --auto
The --auto flag was removed in version 5.10.
fix
Use --retry N instead, e.g., ssh-import-id --retry 3 gh:user.
Upgrade
Version history
5.13latest on PyPI · released Feb 16, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources
ssh-import-id — pip install ssh-import-id · libregistry