🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-08-07 11:17:37 | PHP 8.2.32
📂
/ (Root)
/
usr
/
lib
/
python3.6
/
site-packages
/
cloudinit
/
config
/
__pycache__
📍 /usr/lib/python3.6/site-packages/cloudinit/config/__pycache__
🔄 Refresh
✏️
Editing: cc_keys_to_console.cpython-36.opt-1.pyc
Read Only
3 \�men � @ s� U d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl mZ ddlm Z mZ ddlmZ d Zd gZddd deed�ed�ed�geg d�Ze ee�Z eje�Zdd� Zeee edd�dd�ZdS )zFKeys to Console: Control which SSH host keys may be written to console� N)�dedent)�subp�util)�Cloud)�Config)� MetaSchema�get_meta_doc)�PER_INSTANCEz(%s/cloud-init/write-ssh-key-fingerprints�allZcc_keys_to_consolezKeys to Consolez5Control which SSH host keys may be written to consoleas For security reasons it may be desirable not to write SSH host keys and their fingerprints to the console. To avoid either being written to the console the ``emit_keys_to_console`` config key under the main ``ssh`` config key can be used. To avoid the fingerprint of types of SSH host keys being written to console the ``ssh_fp_console_blacklist`` config key can be used. By default, all types of keys will have their fingerprints written to console. To avoid host keys of a key type being written to console the``ssh_key_console_blacklist`` config key can be used. By default, ``ssh-dss`` host keys are not written to console.z� # Do not print any SSH keys to system console ssh: emit_keys_to_console: false z~ # Do not print certain ssh key types to console ssh_key_console_blacklist: [dsa, ssh-dss] z� # Do not print specific ssh key fingerprints to console ssh_fp_console_blacklist: - E25451E0221B5773DEBFF178ECDACB160995AA89 - FE76292D55E8B28EE6DB2B34B2D8A784F8C0AAB0 )�id�name�title�description�distrosZexamplesZ frequencyZactivate_by_schema_keysc C s, y | j }W n tk r" d}Y nX t| S )Nz/usr/lib)Zusr_lib_exec�AttributeError�HELPER_TOOL_TPL)�distroZbase_lib� r �(/usr/lib/python3.6/cc_keys_to_console.py�_get_helper_tool_pathJ s r )r �cfg�cloud�args�returnc C s� t j|jdi �jdd��r*tjd| � d S t|j�}tjj |�sRtj d| |� d S t j|dg �}t j|ddg�}y@|d j|�d j|�g}t j |�\}} t jd |j� ddd� W n tk r� tj d � � Y nX d S )NZsshZemit_keys_to_consoleTz;Skipping module named %s, logging of SSH host keys disabledz9Unable to activate module %s, helper tool not found at %sZssh_fp_console_blacklistZssh_key_console_blacklistzssh-dss�,z%s F)�stderrZconsolez*Writing keys to the system console failed!)r Zis_false�get�LOG�debugr r �os�path�existsZwarningZget_cfg_option_list�joinr Z multi_log�strip� Exception) r r r r Zhelper_pathZfp_blacklistZ key_blacklist�cmd�stdoutZ_stderrr r r �handleR s, r'