SSH RuntimeException 无法连接到远程服务器

时间:2021-03-22 06:08:45

标签: php laravel

我用这行代码切换到 ssh 连接而不是直接访问文件的路径

$file_from_ssh = SSH::into('local')->getString($file);

但我明白

Unable to connect to remote server.

我正在尝试在我们的本地连接中进行连接。这与使用的私钥有关吗?

我也在laravel日志中得到了这个

 public function getGateway()
    {
        if (!$this->gateway->connected() && !$this->gateway->connect($this->username)) {
            throw new \RuntimeException('Unable to connect to remote server.');
        }

        return $this->gateway;

0 个答案:

没有答案