A library for working with public SSH keys.
Project description
sshkeys
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
Release history Release notifications | RSS feed
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.4.tar.gz
(3.7 kB
view details)
File details
Details for the file sshkeys-0.4.tar.gz
.
File metadata
- Download URL: sshkeys-0.4.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c7a12f00ad59b0a992ae55fccebbe56b9e14e63b089b89e07f6f5ffc4fc9a79 |
|
MD5 | 420be25d335ce82630a973d71b622eab |
|
BLAKE2b-256 | e7e991053a01fb6bf480d18d7b7a1ff921906ed6f34d311d2d55233eb90b16cd |