%PDF- %PDF-
Direktori : /snap/core22/current/usr/share/subiquity/subiquitycore/__pycache__/ |
Current File : //snap/core22/current/usr/share/subiquity/subiquitycore/__pycache__/ssh.cpython-310.pyc |
o K��^) � @ sv d dl Z d dlZd dlZd dlmZ e �d�Zdd� Zdd� Ze d�Z d Ze d �Zdd� Z d d� Zdd� Zdd� ZdS )� N)�run_commandzsubiquitycore.sshc C s| t ddg�} | jdkrt�d| j� g S g }| j�� D ]}|�d�r-|�|� dd�d � qg }|D ] }|� t|�� q2|S )zzQuery sshd to find the host keys and then fingerprint them. Returns a sequence of (key-type, fingerprint) pairs. �sshdz-Tr zsshd -T failed %rzhostkey N� )r � returncode�log�debug�stderr�stdout� splitlines� startswith�append�split�extend�fingerprints)�config�keyfiles�line�info�keyfile� r �)/usr/share/subiquity/subiquitycore/ssh.py�host_key_fingerprints s �r c C s| g }t dd| g�}|jdkrt�d| |j� |S |j�� D ]}|�� �dd�� � }|d }|d �d �}|� ||f� q|S ) Nz ssh-keygenz-lfr zssh-keygen -lf %s failed %r� � r ���z())r r r r r r r �strip�replacer r )r r �cpr �parts�fingerprint�keytyper r r r , s r zThe host key fingerprints are: z$ {keytype:{width}} {fingerprint}z9The {keytype} host key fingerprint is: {fingerprint} c C s t t� �S )N)�summarize_host_keysr r r r r � host_key_infoG s r"