![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/sos/report/plugins/__pycache__/ |
o i��d � @ s* d dl mZmZmZ G dd� dee�ZdS )� )�Plugin�IndependentPlugin� PluginOptc @ sB e Zd ZdZdZdZeddedd�gZdd � Z d d� Z dd � ZdS )�SshzSecure shell service�ssh)�services�security�system�identity� userconfsTz5Changes whether module will collect user .ssh configs)�default�val_type�descc C sF | � ddd�� ddg}| �|� | �|� | �d�r!| �� d S d S )N�sshd_config� ssh_config)z/etc/ssh/sshd_config$z/etc/ssh/ssh_config$z/etc/ssh/ssh_configz/etc/ssh/sshd_configr )� add_file_tags� add_copy_spec�included_configs� get_option�user_ssh_files_permissions)�self�sshcfgs� r �8/usr/lib/python3/dist-packages/sos/report/plugins/ssh.py�setup s �� �z Ssh.setupc C s� zN|D ]H}|� d�d }t| �|�d��/}|D ]$}t|� � �dks&|�d�r'q|�� �d�r;|� � }| j|d |d� qW d � n1 sFw Y qW d S tyX Y d S w ) N�/����rr �#�include� )�tags)�split�open� path_join�len� startswith�lowerr � Exception)r r �sshcfg�tag�cfgfile�line�confargr r r r 0 s$ ������zSsh.included_configsc C s� | � d�}|d r6zt| �d���}|�� }W d � n1 s w Y W n ty5 | �d� Y dS w |d �� }|D ]%}z| �|�d�d d �}| �|�rY| � d � |�� W q> tyc Y q>w dS )z� Iterate over .ssh folders in user homes to see their permissions. Bad permissions can prevent SSH from allowing access to given user. z getent passwd�statusz/etc/passwdNzCouldn't read /etc/passwd�output�:� z.sshz ls -laZ {})�exec_cmdr# r$ � readlinesr( � _log_error� splitlinesr"