无法连接到 homestead MySQL 数据库 - 权限被拒绝(公钥、密码)

发布于 2025-01-20 02:22:53 字数 1578 浏览 5 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浅沫记忆 2025-01-27 02:22:53

您的homestead.yaml文件指示您的SSH键文件位于其典型位置:〜/.ssh/id_rsa。但是,调试输出表明SSH正在另一个位置查找密钥:

debug1: Next authentication method: publickey
debug1: Trying private key: /Users/nielsvroman/.keys/id_rsa
no such identity: /Users/nielsvroman/.keys/id_rsa: No such file or directory
                                     ^^^^^ 

它正在以〜/.keys而不是〜/.ssh来查找。该位置不存在密钥,因此SSH找不到它,也不会将其呈现给远程系统。

根据您的调试输出中的“用户命令”行,SSH正在使用非标准配置文件,/applications/sequel ace.app/contents/resources/ssh_config。此文件可能包含一些配置选项,这些配置选项会导致SSH在.keys目录中查看密钥文件,而不是.ssh Directory。

简单的解决方案是将密钥文件(id_rsa_id_rsa.pub)从您的.ssh目录中的目录复制到此目录。关键文件并不大,并且将它们放在一个以上的地方没有真正的问题。

或者,您可以编辑此特殊的SSH配置文件,以使其在通常的位置寻找关键文件。有必要识别导致SSH查看其他目录并更改或删除的配置选项。看起来这个特殊的配置文件是您安装的一些软件的一部分?更改配置文件可能会影响软件的工作原理,或者它可以为您每次更新软件时为您重新编辑文件。

Your Homestead.yaml file indicates that your ssh key file is in its typical location: ~/.ssh/id_rsa. However, the debug output shows that ssh is looking in another location for the key:

debug1: Next authentication method: publickey
debug1: Trying private key: /Users/nielsvroman/.keys/id_rsa
no such identity: /Users/nielsvroman/.keys/id_rsa: No such file or directory
                                     ^^^^^ 

It's looking in ~/.keys instead of ~/.ssh. The key isn't present in that location, so ssh doesn't find it and doesn't present it to the remote system.

According to the "user command" line in your debug output, ssh is being run using a nonstandard config file, /Applications/Sequel Ace.app/Contents/Resources/ssh_config. It's likely that this file contains some configuration options which cause ssh to look in the .keys directory for key files instead of the .ssh directory.

The simple solution would be to copy your key files (id_rsa and _id_rsa.pub) from your .ssh directory into this .keys directory. The key files aren't large, and there's no real problem with having them in more than one place.

Alternately, you could edit this special ssh config file to make it look for key files in the usual place. It would be necessary to identify the configuration options that are causing ssh to look in the other directory, and change or remove them. It looks like this special config file is part some software that you installed? Changing the config file might affect how the software works, or it could create extra work for you to re-edit the file every time the software is updated.

囚你心 2025-01-27 02:22:53

我个人在 2022 年末也遇到了同样的问题。解决方法是我必须使用 Homestead.yaml 文件中相同的 IP 作为主机地址(默认为 192.168.56.56)。

I personally had the same issue in late 2022. The fix was that I had to use same IP as in the Homestead.yaml file as the host address (which is 192.168.56.56 by default).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文