Connect Manager

SshConnector implements SshConnectorInterface

FinalYes

Устанавливает прикладное SSH/SFTP через NativeSshSession без Composer runtime-зависимостей.

Tags
SuppressWarnings

("PHPMD.ErrorControlOperator")

("PHPMD.CouplingBetweenObjects")

Table of Contents

Interfaces

SshConnectorInterface
Контракт открытия прикладного SSH/SFTP.

Methods

__construct()  : mixed
Создаёт коннектор с SSRF-защитой endpoint.
connect()  : ConnectionInterface
Открывает SSH или SFTP сессию как ConnectionInterface (SshConnection).

Methods

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
throws
ConnectionException

Без auth, при TCP/SSH ошибке или SSRF-блокировке

Attributes
#[Override]
Return values
ConnectionInterface —

Экземпляр SshConnection

On this page

Search results