//lib/python2.7/site-packages/cloudinit/config/

OS : Linux

PHP Version : 7.4.33

Software : Apache/2.4.6 (CentOS) PHP/7.4.33

Information System : Linux apprendre2 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64

Disable Function : ó oBú]c@s˜dZddlZddlZddlmZddlmZddlmZddlm Z d„Z dd „Z d „Z dd d „Z d „ZdS(s SSH Authkey Fingerprints ------------------------ **Summary:** log fingerprints of user ssh keys Write fingerprints of authorized keys for each user to log. This is enabled by default, but can be disabled using ``no_ssh_fingerprints``. The hash type for the keys can be specified, but defaults to ``md5``. **Internal name:** `` cc_ssh_authkey_fingerprints`` **Module frequency:** per instance **Supported distros:** all **Config keys**:: no_ssh_fingerprints: authkey_hash: iÿÿÿÿN(t SimpleTable(tug_util(tssh_util(tutilcCsEg}x8tdt|ƒdƒD]}|j|||d!ƒqW|S(Nii(trangetlentappend(tbin_hashtsplit_upti((sP/usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_authkey_fingerprints.pyt _split_hash&stmd5cCsk|s dSyBtj|ƒ}|jtj|ƒƒdjt|jƒƒƒSWntt fk rfdSXdS(Ntt:t?( thashlibtnewtupdatetbase64t b64decodetjoinR t hexdigestt TypeErrort ValueError(tb64_textt hash_meththasher((sP/usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_authkey_fingerprints.pyt_gen_fingerprint-scCsSt|j|j|j|jgƒrO|jrO|jjƒjƒdkrOtSntS(Nsssh-dsssssh-rsa(sssh-dsssssh-rsa( tanytkeytypeRtcommenttoptionstlowertstriptTruetFalse(tentry((sP/usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_authkey_fingerprints.pyt_is_printable_key<s $ s ci-info: c CsO|s'd||f}tj|ƒdSdd|ddg}t|ƒ}xi|D]a}t|ƒrP|jpndt|j|ƒpƒd|jpd|jp›dg} |j | ƒqPqPW|j ƒ} | j ƒ} t t | dt ƒƒ} tjd||fd | ƒg} | j| ƒx4| D],}tjd d ||fd td tƒqWdS(Ns9%sno authorized ssh keys fingerprints found for user %s. tKeytypesFingerprint (%s)tOptionstCommentt-tkeys#Authorized keys from %s for user %st+ttexts%s%s tstderrtconsole(Rt multi_logRR%RRRRRtadd_rowt get_stringt splitlinesRtmaxtcentertextendR#R"(tusertkey_fnt key_entriesRtprefixtmessaget tbl_fieldsttblR$trowt authtbl_st authtbl_linestmax_lentlinestline((sP/usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_authkey_fingerprints.pyt_pprint_key_entriesDs0              c Cs¨tj|jdtƒƒr/|jd|ƒdStj|ddƒ}tj||jƒ\}}xB|j ƒD]4\}} t j |ƒ\} } t || | |ƒqlWdS(Ntno_ssh_fingerprintss>Skipping module named %s, logging of ssh fingerprints disabledt authkey_hashR ( Rtis_truetgetR#tdebugtget_cfg_option_strRtnormalize_users_groupstdistrotitemsRtextract_authorized_keysRC( tnametcfgtcloudtlogt_argsRtuserst_groupst user_namet_cfgR7R8((sP/usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_authkey_fingerprints.pythandlebs  (t__doc__RRtcloudinit.simpletableRtcloudinit.distrosRt cloudinitRRR RR%RCRW(((sP/usr/lib/python2.7/site-packages/cloudinit/config/cc_ssh_authkey_fingerprints.pyts