Agent

Pure-PHP ssh-agent client identity factory

requestIdentities() method pumps out \phpseclib3\System\SSH\Agent\Identity objects

author

Jim Wigginton terrafrost@php.net

package

Default

Methods

Default Constructor

__construct( $address = null): \phpseclib3\System\SSH\Agent
Throws
\phpseclib3\Exception\BadConfigurationException

if SSH_AUTH_SOCK cannot be found

\RuntimeException

on connection errors

Arguments

$address

Response

\phpseclib3\System\SSH\Agent

Forward data to SSH Agent and return data reply

forwardData(string $data): string
Throws
\RuntimeException

on connection errors

Arguments

$data

string

Response

string

Data from SSH Agent

Read data

readBytes(integer $length)
inherited
Throws
\RuntimeException

on connection errors

Arguments

$length

integer

On successful channel open

registerChannelOpen(\phpseclib3\Net\SSH2 $ssh)

This method is called upon successful channel open to give the SSH Agent an opportunity to take further action. i.e. request agent forwarding

Arguments

Request agent forwarding of remote server

request_forwarding(\phpseclib3\Net\SSH2 $ssh): boolean

Arguments

Response

boolean

Request Identities

requestIdentities(): array

See "2.5.2 Requesting a list of protocol 2 keys" Returns an array containing zero or more \phpseclib3\System\SSH\Agent\Identity objects

Throws
\RuntimeException

on receipt of unexpected packets

Response

array

Signal that agent forwarding should be requested when a channel is opened

startSSHForwarding(): void

Constants

SSH_AGENTC_REQUEST_IDENTITIES

SSH_AGENTC_REQUEST_IDENTITIES

SSH_AGENT_IDENTITIES_ANSWER

SSH_AGENT_IDENTITIES_ANSWER

SSH_AGENTC_SIGN_REQUEST

SSH_AGENTC_SIGN_REQUEST

SSH_AGENT_SIGN_RESPONSE

SSH_AGENT_SIGN_RESPONSE

FORWARD_NONE

FORWARD_NONE

FORWARD_REQUEST

FORWARD_REQUEST

FORWARD_ACTIVE

FORWARD_ACTIVE

Unused

SSH_AGENT_FAILURE

Properties

Socket Resource

fsock :resource
var

Type(s)

resource

Agent forwarding status

forward_status :integer
var

Type(s)

integer

Buffer for accumulating forwarded authentication agent data arriving on SSH data channel destined for agent unix socket

socket_buffer :string
var

Type(s)

string

Tracking the number of bytes we are expecting to arrive for the agent socket on the SSH data channel

expected_bytes :integer
var

Type(s)

integer