我有一台服务器,我通过 SSH 连接到我的密钥文件,例如id_rsa.pub. 我在客户端和服务器端使用 Debian。
我按照教程禁用 root 身份验证和密码使用以提高安全性(通过/etc/ssh/sshd/sshd_config在服务器上配置文件)。
到目前为止,我可以轻松rsync地将我的文件从我的计算机同步到服务器。
几天前, 我使用了一个 cron 作业,为此我不得不在服务器端重置我的 root 密码。
从那以后,我就无法使用rsyncin SSH; 我收到以下消息:
nextcloud@192.168.0.20: Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far)[sender]
rsync error: unexplained error (code 255) at io.c(235)[sender=3.1.3]
Run Code Online (Sandbox Code Playgroud)
有一些类似的主题,但我认为我的情况有点不同,因为我认为问题是由于在服务器上重置了我的密码。我也在 Ask Ubuntu 网站上问过一个问题,但我认为这里的人可能更擅长权限问题。
我不知道如何解决这个问题(我在终端命令中管理了一点,但我不是计算机专家)。请问你能帮帮我吗?
仅供参考,请找到调整/etc/ssh/sshd_config不使用密码的教程:
#Uncomment or add the following line.
#This allows the server to give its DSA footprint in case of an ssh connection.
HostKey /etc/ssh/ssh/ssh_host_dsa_key …Run Code Online (Sandbox Code Playgroud)