function FileTransferSSH::connect

Overrides FileTransfer::connect

File

includes/filetransfer/ssh.inc, line 16

Class

FileTransferSSH
The SSH connection class for the update module.

Code

function connect() {
    $this->connection = @ssh2_connect($this->hostname, $this->port);
    if (!$this->connection) {
        throw new FileTransferException('SSH Connection failed to @host:@port', NULL, array(
            '@host' => $this->hostname,
            '@port' => $this->port,
        ));
    }
    if (!@ssh2_auth_password($this->connection, $this->username, $this->password)) {
        throw new FileTransferException('The supplied username/password combination was not accepted.');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.