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

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for sshkeys-0.3.tar.gz
Algorithm Hash digest
SHA256 a69a422933f86535cae76271af7ac671c425709a44a1ab78a9dcb9912174da08
MD5 005766af3b8ed316ec4d8d8ae45b138e
BLAKE2b-256 706168bed1d5028e25809c409d983bc30567aad89299ffcab4ad44f2637a5b7f

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