HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/self/root/usr/lib/python3/dist-packages/twisted/conch/__pycache__/tap.cpython-38.pyc
U


W[o�@srdZddlmZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
Gdd	�d	eje	j�Zd
d�ZdS)
z4
Support module for making SSH servers with twistd.
�)�unix)�checkers)�factory)�portal�strcred)�usage)�strportscs�eZdZdZdZddddgddd	d
gddd
dgddddggZejejdd�ejdd�e�	�d�d�Z
�fdd�Z�fdd�Z�Z
S)�Optionsz([-i <interface>] [-p <port>] [-d <dir>] z�Makes a Conch SSH server.  If no authentication methods are specified, the default authentication methods are UNIX passwords and SSH public keys.  If --auth options are passed, only the measures specified will be used.�	interface�i�z"local interface to which we listen�port�pztcp:22zPort on which to listen�data�dz/etcz"directory to look for host keys in�moduliNz:directory to look for moduli in (if different from --data)zdata directory)Zdescrzmoduli directory)rrr
)Z
optActionscsLtjj|f|�|�tt|��t���tt|��t�t����d|_	dS)NT)
rr	�__init__�super�
addChecker�conch_checkersZUNIXPasswordDatabaseZSSHPublicKeyCheckerZUNIXAuthorizedKeysFiles�_usingDefaultAuth)�self�a�kw��	__class__��3/usr/lib/python3/dist-packages/twisted/conch/tap.pyr%s�zOptions.__init__cs0|jrg|d<i|d<d|_tt|��|�dS)z�
        Add the checker specified.  If any checkers are added, the default
        checkers are automatically cleared and the only checkers will be the
        specified one(s).
        �credCheckersZcredInterfacesFN)rrr	r)rZcheckerrrrr2s
zOptions.addChecker)�__name__�
__module__�__qualname__ZsynopsisZlongdescZ
optParametersrZCompletionsZCompleteDirsZCompleteNetInterfacesZcompDatarr�
__classcell__rrrrr	s



�

��
r	cCsnt��}t��}t�||�dg��|_|d|_|dp>|d|_|d}|drb|d|d7}t	�
||�S)aH
    Construct a service for operating a SSH server.

    @param config: An L{Options} instance specifying server options, including
        where server keys are stored and what authentication methods to use.

    @return: A L{twisted.application.service.IService} provider which contains
        the requested SSH server.
    rrrr
r
z:interface=)rZOpenSSHFactoryrZUnixSSHRealmrZPortal�getZdataRootZ
moduliRootr�service)Zconfig�t�rr
rrr�makeService@s
r'N)�__doc__Z
twisted.conchrrrZtwisted.conch.openssh_compatrZtwisted.credrrZtwisted.pythonrZtwisted.applicationrr	ZAuthOptionMixinr'rrrr�<module>s/