Skip to main content

OpenSSH known_hosts file edit tool

Project description

OpenSSH known_hosts file edit tool

This is a helper class to edit ~/.ssh/known_hosts. It mostly calls the appropriate ssh-keygen commands. It automatically hashes hostnames if there are already hashed hostnames in ~/.ssh/known_hosts.

Usage:

from ssh_known_hosts_edit import SSHKnownHostsEdit

edit = SSHKnownHostsEdit()
edit.add_to_known_hosts('github.com',
                        'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl')
edit.add_to_known_hosts('github.com',
                        'ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=')
edit.remove_from_known_hosts_by_host('github.com')

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

ssh_known_hosts_edit-0.2.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

ssh_known_hosts_edit-0.2.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file ssh_known_hosts_edit-0.2.0.tar.gz.

File metadata

  • Download URL: ssh_known_hosts_edit-0.2.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for ssh_known_hosts_edit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 204dc279e09976069b28ae70735f097360e5f37be98f193d7aeef1540194ad2a
MD5 29bc39a8cc4d0ca7de68cd1289cac5b8
BLAKE2b-256 ca699339a3ca51d4a3e2d04c99aba481086a7561dc5a5c4fa38e199b6cfa22dd

See more details on using hashes here.

File details

Details for the file ssh_known_hosts_edit-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ssh_known_hosts_edit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 170da55a22603660e4f16d14aa774e7382f23263233d445dbfd53a8bcf4fcbb7
MD5 43e843035a0e220464fc3d3e0eca3689
BLAKE2b-256 c4be899ae5af7b8a6c7881fb019cf881c0ce749d5509609919bc77162d102e54

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