Home | Trees | Index | Help |
---|
Package paramiko :: Class HostKeys |
|
object
--+
|
HostKeys
Representation of an openssh-style "known hosts" file. Host keys can be read from one or more files, and then individual hosts can be looked up to verify server keys during SSH negotiation.
A HostKeys object can be treated like a dict; any dict lookup is equivalent to callinglookup
.
Since: 1.5.3
Method Summary | |
---|---|
Create a new HostKeys object, optionally loading keys from an openssh style host-key file. | |
__getitem__(self,
key)
| |
__len__(self)
| |
Add a host key entry to the table. | |
bool |
Return True if the given key is associated with the given hostname in this dictionary. |
Remove all host keys from the dictionary. | |
str |
Return a "hashed" form of the hostname, as used by openssh when storing hashed hostnames in the known_hosts file. (Static method) |
Read a file of known SSH host keys, in the format used by openssh. | |
dict(str, PKey )
|
Find a hostkey entry for a given hostname or IP. |
values(self)
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Instance Method Details |
---|
__init__(self,
filename=None)
Create a new HostKeys object, optionally loading keys from an
openssh style host-key file.
|
add(self, hostname, keytype, key)Add a host key entry to the table. Any existing entry for a(hostname, keytype) pair will be replaced.
|
check(self, hostname, key)Return True if the given key is associated with the given hostname in this dictionary.
|
clear(self)Remove all host keys from the dictionary. |
load(self, filename)Read a file of known SSH host keys, in the format used by openssh. This type of file unfortunately doesn't exist on Windows, but on posix, it will usually be stored inos.path.expanduser("~/.ssh/known_hosts") .
|
lookup(self, hostname)Find a hostkey entry for a given hostname or IP. If no entry is found,None is returned. Otherwise a dictionary of keytype
to key is returned.
|
Static Method Details |
---|
hash_host(hostname, salt=None)Return a "hashed" form of the hostname, as used by openssh when storing hashed hostnames in the known_hosts file.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Feb 19 23:24:07 2006 | http://epydoc.sf.net |