sshd[2615]: 通过验证用户 vagrant 192.168.77.13 关闭连接。如何配置 sshd?

sshd[2615]: 通过验证用户 vagrant 192.168.77.13 关闭连接。如何配置 sshd?

我的 Ubuntu 18.04 上有四个 Vagrant VM。当我尝试将 ssh 密钥从我的服务器复制到目标时

ssh-copy-id [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/vagrant/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]: Permission denied (publickey).

为什么权限被拒绝?

现在我正在查看 var/log/auth.log(target)

May  9 06:17:01 ubuntu-bionic CRON[2625]: pam_unix(cron:session): session opened for user root by (uid=0)
May  9 06:17:01 ubuntu-bionic CRON[2625]: pam_unix(cron:session): session closed for user root
May  9 06:18:32 ubuntu-bionic sshd[2628]: Connection closed by authenticating user vagrant 192.168.77.13 port 59904 [preauth]
May  9 06:18:32 ubuntu-bionic sshd[2630]: Connection closed by authenticating user vagrant 192.168.77.13 port 59906 [preauth]
May  9 06:18:32 ubuntu-bionic sshd[2632]: Connection closed by authenticating user vagrant 192.168.77.13 port 59908 [preauth]
May  9 06:18:43 ubuntu-bionic sudo:  vagrant : TTY=pts/0 ; PWD=/ ; USER=root ; COMMAND=/bin/cat /var/log/auth.log
May  9 06:18:43 ubuntu-bionic sudo: pam_unix(sudo:session): session opened for user root by vagrant(uid=0)

如何配置 sshd 以摆脱权限问题?

相关内容