Skip to main content

A library for working with public SSH keys.

Project description

sshkeys

https://travis-ci.org/mbr/sshkeys.svg?branch=master

sshkeys is a small library for reading SSH public keys, extracting some information from them and possibly outputting them again. It’s mainly useful when dealing with scripts that manipulate ~/.ssh/authorized_keys or handle user’s public keys in other ways.

sshkeys supports Python 2.6, 2.7, 3.3, 3.4.

Example

Here’s a small example session:

>>> from sshkeys import Key
>>> k = Key.from_pubkey_file('sample_rsa.key.pub')
>>> print k.readable_fingerprint
b9:e2:58:1a:74:fc:62:13:52:ad:f7:28:0b:09:91:54
>>> print k.comment
sample_rsa_key@host
>>> k.comment = 'command="nothing",no-x11-forwarding'
>>> print k.to_pubkey_line()
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDDN2n2kt99/aYpPbOZRJeGVyFs74R1/QCqN351cuXLGK93lalDyIuIiUvMEYezregae1xDWXtCD+q9HMQpfl62R2R1h3b8CMX8fpcGGXHJAxFWg/Sz8qXcbOeTRKdnBIWlUrkDi/7hWKZdXLsiSPJeX9wmLhA5HCdHye1yFlGxSixTVK2fXyS9ZFEbBcIL8Aiq2EMQktCy2gDOiJArpCF7pvsGqiLUxdCpOT+wuL+oGV47yVveGt9TcesnmZ1HxESXAIS22Vo2MnTABxdNxNrs1ih3+4wdJ+gpoLo0lRNdjARRlcoH/fJvrXdbOrf//ARzuR9JKfyKz+9aUEPxGtlEStbVysTjY2M3+Z4msbxh4x3ezpujhzpFCeLDHcAPg/HS6GoO7zGcdJ8knCZK5ujOvFku03Es+jLrGNjACDOlLSYf9RHPqHvo/Fn+lCLJWZoc0qiuICuHbEDU0fJ4qbVovZtdQtTwzQ8Az+VsLhJfehhadvb5hOCw3o4i9j1dJzcNfKJiBhab25GdfEYE097fDoYu/M0mi14AHWR0KI9o9Fd526x9B6c6gfljbHJZcMGXhzfyO6nIsbZK6teJR7qh/8EQ7shOyfdcJkexvsbeNm12VTW34ar+FjrApgN1QtY1+/6SDNSeOQqnBu2qENQVllSCfxOholMnVpO5ly1G2Q== command="nothing",no-x11-forwarding

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sshkeys-0.5.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file sshkeys-0.5.tar.gz.

File metadata

  • Download URL: sshkeys-0.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sshkeys-0.5.tar.gz
Algorithm Hash digest
SHA256 02dd3f2a636e2cb70139620f0ee5f57584671c1710c7893ccaa8f7a1bc396957
MD5 7ca2e3f5330911f5e537ac588f453b2d
BLAKE2b-256 3c301ded51ef8673ec52efa342591e90ce484587cecd39b0436ecf238bdc25dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page