protected function createResource()
    {
        $resource = $this->connect($this->configuration->asArguments());

        if (!is_resource($resource)) {
            throw new RuntimeException('The SSH connection failed.');
        }

        $this->resource = $resource;

        if (null !== $this->authentication) {
            $this->authenticate();
        }
    }