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('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.0.1.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

ssh_known_hosts_edit-0.0.1-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

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