%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/ssh_known_hosts.pyo

�
���^c
@@s�dZddlmZmZmZddlZddlZddlm	Z	dZ
d�Zdddddde
ddd�	Zddd	�ZdS(
u�
Control of SSH known_hosts entries
==================================

Manage the information stored in the known_hosts files.

.. code-block:: yaml

    github.com:
      ssh_known_hosts:
        - present
        - user: root
        - fingerprint: 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
        - fingerprint_hash_type: md5

    example.com:
      ssh_known_hosts:
        - absent
        - user: root
i(tabsolute_importtunicode_literalstprint_functionN(tCommandNotFoundErrorussh_known_hostscC@s tjjj�rtdfStS(uA
    Does not work on Windows, requires ssh module functions
    u)ssh_known_hosts: Does not support Windows(tsalttutilstplatformt
is_windowstFalset__virtualname__(((s?/usr/lib/python2.7/site-packages/salt/states/ssh_known_hosts.pyt__virtual__#s
ic
C@s'i|d6id6tdr!d+ntd6dd6}
|sG|pAd}n|pPd}|r�tjj|�r�d	}t|
d<t|
d
|�Stdr�|r�|r�d}t|
d<t|
d
|�S|r�|r�d}t|
d<t|
d
|�Sy5td
||d|d|d|d|d|	�}Wn1t	k
rX}
t|
d<dj
|
�|
d<|
SX|dkr�dj
||�}t|
d<t|
d
|�S|dkr�dj
||�}t|
d
|�Sdj
||�}t|
d
|�Sntdd|d|d|d|d|d|d|d|d|d|	�
}|ddkrYt|
d
d j
||��S|dd!kr�t|
d"td
|d!�S|r�|d#d$d%}t|
d&i|d'd'6|d#d#6d
d(j
|||��S|d#d$d)}t|
d&i|d'd'6|d#d#6d
d*j
|||��Sd+S(,uQ
    Verifies that the specified host is known by the specified user

    On many systems, specifically those running with openssh 4 or older, the
    ``enc`` option must be set, only openssh 5 and above can detect the key
    type.

    name
        The name of the remote host (e.g. "github.com")
        Note that only a single hostname is supported, if foo.example.com and
        bar.example.com have the same host you will need two separate Salt
        States to represent them.

    user
        The user who owns the ssh authorized keys file to modify

    fingerprint
        The fingerprint of the key which must be present in the known_hosts
        file (optional if key specified)

    key
        The public key which must be present in the known_hosts file
        (optional if fingerprint specified)

    port
        optional parameter, port which will be used to when requesting the
        public key from the remote host, defaults to port 22.

    enc
        Defines what type of key is being used, can be ed25519, ecdsa ssh-rsa
        or ssh-dss

    config
        The location of the authorized keys file relative to the user's home
        directory, defaults to ".ssh/known_hosts". If no user is specified,
        defaults to "/etc/ssh/ssh_known_hosts". If present, must be an
        absolute path when a user is not specified.

    hash_known_hosts : True
        Hash all hostnames and addresses in the known hosts file.

    timeout : int
        Set the timeout for connection attempts.  If ``timeout`` seconds have
        elapsed since a connection was initiated to a host or since the last
        time anything was read from that host, then the connection is closed
        and the host in question considered unavailable.  Default is 5 seconds.

        .. versionadded:: 2016.3.0

    fingerprint_hash_type
        The public key fingerprint hash type that the public key fingerprint
        was originally hashed with. This defaults to ``sha256`` if not specified.

        .. versionadded:: 2016.11.4
        .. versionchanged:: 2017.7.0: default changed from ``md5`` to ``sha256``

    unameuchangesutesturesultuucommentu/etc/ssh/ssh_known_hostsu.ssh/known_hostsu9If not specifying a "user", specify an absolute "config".tcommentu0Specify either "key" or "fingerprint", not both.u0Required argument "enc" if using "key" argument.ussh.check_known_hosttkeytfingerprinttconfigtporttfingerprint_hash_typeussh.check_known_host error: {0}uexistsuHost {0} is already in {1}uaddu%Key for {0} is set to be added to {1}u'Key for {0} is set to be updated in {1}ussh.set_known_hosttuserthostnametencthash_known_hoststtimeoutustatusu{0} already exists in {1}uerrortresultunewiukeytchangesuoldu!{0}'s key saved to {1} (key: {2})ufingerprintu){0}'s key saved to {1} (fingerprint: {2})N(t__opts__tNonetTruetostpathtisabsRtdictt__salt__Rtformat(tnameRR
RRRRRRRtretRRterrtnew_key((s?/usr/lib/python2.7/site-packages/salt/states/ssh_known_hosts.pytpresent-s�D









				
				cC@sci|d6id6td6dd6}|s7|p1d}n|p@d}|r}tjj|�r}d}t|d<t|d	|�Std
d|d|d
|�}|s�t|d	d�Stdr�dj||�}d|d<t|d	|�Stdd|d|d
|�}|ddkr1t|dtd	|d�St|di|d6dd6dtd	|d�SdS(u�
    Verifies that the specified host is not known by the given user

    name
        The host name
        Note that only single host names are supported.  If foo.example.com
        and bar.example.com are the same machine and you need to exclude both,
        you will need one Salt state for each.

    user
        The user who owns the ssh authorized keys file to modify

    config
        The location of the authorized keys file relative to the user's home
        directory, defaults to ".ssh/known_hosts". If no user is specified,
        defaults to "/etc/ssh/ssh_known_hosts". If present, must be an
        absolute path when a user is not specified.
    unameuchangesuresultuucommentu/etc/ssh/ssh_known_hostsu.ssh/known_hostsu9If not specifying a "user", specify an absolute "config".Russh.get_known_host_entriesRRRuHost is already absentutestu)Key for {0} is set to be removed from {1}ussh.rm_known_hostustatusuerrorRRuoldunewN(
RRRRRRRRR R(R!RRR"Rt
known_hostt	rm_result((s?/usr/lib/python2.7/site-packages/salt/states/ssh_known_hosts.pytabsent�s4



		
	(t__doc__t
__future__RRRRtsalt.utils.platformRtsalt.exceptionsRR	R
RRR%R((((s?/usr/lib/python2.7/site-packages/salt/states/ssh_known_hosts.pyt<module>s 	�

Zerion Mini Shell 1.0