Laravel 5.2通过SSH连接到远程数据库

时间:2019-03-14 12:55:32

标签: php database laravel laravel-5 ssh

我正在通过ssh隧道连接到远程数据库

提到here

以下是DBeaver的屏幕截图:

enter image description here

还有

enter image description here

我正在为ssh做的是:

ssh -i sharp -N -L 13306:127.0.0.1:3306 root@163.182.198.10

但是它说

Permission denied (publickey).

我想念什么?

1 个答案:

答案 0 :(得分:-1)

您指定的公共密钥不正确。

我的意思是,您给我们的错误告诉您。

-i identity_file
             Selects a file from which the identity (private key) for public key authentication is read.  The default is ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and
             ~/.ssh/id_rsa.  Identity files may also be specified on a per-host basis in the configuration file.  It is possible to have multiple -i options (and multiple
             identities specified in configuration files).  If no certificates have been explicitly specified by the CertificateFile directive, ssh will also try to load cer-
             tificate information from the filename obtained by appending -cert.pub to identity filenames.

出于好奇,是什么阻止了您使用此功能?

https://packagist.org/packages/stechstudio/laravel-ssh-tunnel

也:

如果您阅读注释,则会发现一些问题,这些问题报告了-N选项的问题。尝试将其删除。

-N Do not execute a remote command. This is useful for just forwarding ports.