【问题标题】:Laravel 5.2 connect to remote DB via sshLaravel 5.2 通过 ssh 连接到远程数据库
【发布时间】:2019-08-05 09:11:55
【问题描述】:

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

提到here

这是 DBeaver 屏幕截图:

还有

我正在为 ssh 做的是:

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

但它说

Permission denied (publickey).

我错过了什么?

【问题讨论】:

    标签: php database laravel laravel-5 ssh


    【解决方案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

    还有:

    如果您阅读 cmets,您会发现一些使用 -N 选项报告问题的问题。尝试删除它。

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

    【讨论】:

    • 我之前也删除了 -N 并且不起作用,我的问题是为什么上述方法不起作用,如果 dbeaver 使用相同的方法,那么为什么它在我的终端上不起作用
    猜你喜欢
    • 2017-04-25
    • 1970-01-01
    • 1970-01-01
    • 2010-12-30
    • 2019-03-30
    • 2015-03-01
    • 1970-01-01
    • 2014-01-13
    相关资源
    最近更新 更多