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.2.tar.gz (3.1 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for sshkeys-0.2.tar.gz
Algorithm Hash digest
SHA256 5daa831123e47a2e4272304de1e6dc29f155b091e92e95bced2dcaab3c2b578a
MD5 f8db478e3c5956ae9116dbfd17f7d70b
BLAKE2b-256 33249671901008a9b9744ea0631a53aa869122866ade883f881a7d3add03e3f2

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