https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/sos/report/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/sos/report/plugins/__pycache__/ssh.cpython-310.pyc
o

-�_g��@s>ddlZddlmZddlmZmZmZGdd�dee�ZdS)�N��glob)�Plugin�IndependentPlugin�	PluginOptc@sBeZdZdZdZdZeddedd�gZdd	�Z	d
d�Z
dd
�ZdS)�SshzSecure shell service�ssh)�services�security�system�identity�	userconfsTz5Changes whether module will collect user .ssh configs)�default�val_type�desccCsF|�ddd��gd�}|�|�|�|�|�d�r!|��dSdS)N�sshd_config�
ssh_config)z/etc/ssh/sshd_config$z/etc/ssh/ssh_config$)z/etc/ssh/ssh_configz/etc/ssh/sshd_configz/etc/ssh/sshd_config.d/*r
)�
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�setups�


�z	Ssh.setupc	Cs�z\dd�dd�|D�D�}|D]J}|�d�d}t|�|�ddd��/}|D]$}t|���d	ks4|�d
�r5q%|���d�rI|��}|j|d|d
�q%Wd�n1sTwYqWdStyfYdSw)z Include subconfig files cSsg|]	}|D]}|�qqSrr)�.0�files�frrr�
<listcomp>7s���z(Ssh.included_configs.<locals>.<listcomp>cSsg|]}t|dd��qS)T)�	recursiver)r�copyspecrrrr 8s��/����r�UTF-8��encodingr�#�include�)�tagsN)�split�open�	path_join�len�
startswith�lowerr�	Exception)rr�cfgfiles�sshcfg�tag�cfgfile�line�confargrrrr3s4���������zSsh.included_configsc
Cs�t��}i}z,tdddd��}|D]}|��dd�\}}|||<qWd�n1s,wYWntyA|�d�YdSwhd	�}|D]%}|j|vra||j|vra|�d
|j�d��qH|�|jd�}	|�	|	�qHdS)
z�
        Iterate over .ssh folders in user homes to see their permissions.

        Bad permissions can prevent SSH from allowing access to given user.
        z/proc/mountsr%r&r'r+�NzCouldn't read /proc/mounts>�nfs�nfs4�autofszSkipping capture in z  because it's a remote directoryz.ssh)
�pwd�getpwallr.r-r3�
_log_error�pw_dir�	_log_infor/�add_dir_listing)
r�
users_data�
fs_mount_info�mounts_filer8�fs_file�	fs_vstype�non_local_fs�user�home_dirrrrrKs2
���
�
��zSsh.user_ssh_files_permissionsN)�__name__�
__module__�__qualname__�
short_desc�plugin_name�profilesr�str�option_listrrrrrrrrs��r)r>r�sos.report.pluginsrrrrrrrr�<module>s


https://t.me/RX1948 - 2025