权限被拒绝(公钥) - Digital Ocean

Mot*_*art 1 ssh ubuntu

这绝对是重复的,但我尽可能多地浏览了其他答案,我首先在数字海洋论坛上发布,我联系了 DO 支持,但我仍然无法访问我的服务器。

我试过:

  1. 使用ssh-keygen并制作一个名为 id_rsa3 的密钥(id_rsa 有效,但已被占用)。通过复制/粘贴将创建时的 SSH 密钥添加到 DO 仪表板。这个方法没有奏效。我摧毁了水滴并重新开始。
  2. 重新创建了新密钥并执行了操作ssh-copy-id -i ~/.ssh/id_rsa3 root@MY-IP。然后就做了ssh -v -i ~/.ssh/id_rsa3 root@MY-IP测试。Permission denied (publickey). 我摧毁了水滴并重新开始。
  3. 重新创建了新密钥。登录 DO 控制台,然后转到/etc/ssh/authorized_keys并粘贴与我的本地密钥匹配的公钥。然后ssh -v -i ~/.ssh/id_rsa3 root@MY-IP进行测试。不过,Permission denied (publickey).消灭水滴,再试一次。
  4. Created a ~/.ssh/config and tried to get the droplet to choose the correct key. Might be some syntax problems here. It runs the config, but does not get the correct key.

    Host sinatra_app HostName 206.***.***.*04 AddKeysToAgent yes UseKeychain yes User root PubKeyAuthentication yes IdentityFile ~/.ssh/id_rsa3 IdentitiesOnly yes

UPDATE: Destroyed droplet and added new keys. It asks me for a PW even with SSH. If I changed the PasswordAuthentication no it will then say Permission denied (publickey). So this is where I am stuck now. With access but cannot remove PW.

EDM*_*OZO 6

我遇到了同样的问题,要解决它,您打开 digitalocean ,打开控制台(如在网络中)并使用您的 root 密码登录,

然后sudo nano /etc/ssh/sshd_configPasswordAuthentication从no更改为yes 保存并重新启动sudo service ssh restart

就这样。