SshConnector
in package
implements
SshConnectorInterface
FinalYes
Устанавливает прикладное SSH/SFTP через NativeSshSession без Composer runtime-зависимостей.
Tags
Table of Contents
Interfaces
- SshConnectorInterface
- Контракт открытия прикладного SSH/SFTP.
Methods
- __construct() : mixed
- Создаёт коннектор с SSRF-защитой endpoint.
- connect() : ConnectionInterface
- Открывает SSH или SFTP сессию как ConnectionInterface (SshConnection).
Methods
__construct()
Создаёт коннектор с SSRF-защитой endpoint.
public
__construct([EndpointGuard $guard = new EndpointGuard() ]) : mixed
Parameters
- $guard : EndpointGuard = new EndpointGuard()
-
Проверка и DNS-pinning целевого хоста
connect()
Открывает SSH или SFTP сессию как ConnectionInterface (SshConnection).
public
connect(string $protocolId, string $endpoint, ConnectionOptions $options) : ConnectionInterface
Открывает TCP, выполняет SSH handshake/auth и возвращает SshConnection.
Parameters
- $protocolId : string
-
«ssh» или «sftp» (для sftp сразу поднимается subsystem)
- $endpoint : string
-
Хост:порт или URI, прошедший EndpointGuard
- $options : ConnectionOptions
-
Таймауты и AuthCredentials (password или publickey)
Tags
Attributes
- #[Override]
Return values
ConnectionInterface —Экземпляр SshConnection