SSH 权限被拒绝(公钥)- Laravel Forge

SSH permission denied (publickey) - Laravel Forge

我遵循了 Jeffrey Way 的 instructions 并且我在终端中不断收到相同的 SSH 错误。

我想通过 Sequel Pro 进行连接,进一步深入研究后,这是最准确的日志描述:

debug1: Host 'IP ADDRESS' is known and matches the RSA host key.
debug1: Found key in /Users/ben/.ssh/known_hosts:17
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/ben/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /Users/ben/.ssh/id_rsa.pub
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

我用这种方式生成我的 SSH 密钥:

ssh-keygen -t rsa -C "your_email@example.com"

然后复制到Laravel Forge by:

cat ~/.ssh/id_rsa.pub | pbcopy

保存无误。但是后来我尝试 forge@ip_address 并且它总是 returns Permission denied 错误。

如有任何帮助,我们将不胜感激。

我按照说明遇到了同样的问题。

尝试:

pbcopy < ~/.ssh/id_rsa.pub

我通过在 Forge 上重新创建服务器解决了这个问题。 pbcopy 也失败了。

如果您在创建服务器后从 Forge“帐户”>“SSH 密钥”页面添加了您的密钥,您还需要在此处添加您的密钥:

  • 服务器 > [您的服务器名称] > SSH 密钥 > 添加