由于无法找到文件,ssh 要求输入密码

由于无法找到文件,ssh 要求输入密码

我一直在摆弄我的 SSH 密钥,现在我正试图让它工作。我已经转移了 .pub 和用于连接到名为 的服务器的 SSH 文件saleslist

现在我把它们搬到了那里~/.ssh/,酒吧和普通酒吧都在那里。

然而,当我尝试通过 SSH 连接到我的服务器时,即使是在我注册的部署帐户上,我也会被要求输入密码--disabled-password

我跑了ssh -v sebastian@ip,它返回了:

debug1: Found key in /Users/Sebastian/.ssh/known_hosts:43
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,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/Sebastian/.ssh/github_rsa
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: /Users/Sebastian/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/Sebastian/.ssh/id_dsa
debug1: Trying private key: /Users/Sebastian/.ssh/id_ecdsa
debug1: Trying private key: /Users/Sebastian/.ssh/id_ed25519
debug1: Next authentication method: password

有人知道我该如何解决这个问题吗?

答案1

确保公钥已上传并在远程主机上可用~/.ssh/authorized_keys

~/.ssh另外,请确保该目录的权限为 700 (drwx-----) 和 600 (-rw-----) ~/.ssh/authorized_keys

相关内容