背景:
我从一台服务器上同步数据到另一台服务器上:

# [star-001 root 15:12:14] [五 9月 03] 
$ rsync fe/ xxx@xxx:/data/software/xxx/
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]

然后这时候我用ssh:
想着最起码能出来个输入密码的提示,测试一下,结果:

$ ssh xxx@xxx
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

这都不行,然后就看到了这位大哥的文章:

解决办法

sudo vim /etc/ssh/sshd_config
增加如下修改
PasswordAuthentication yes


sudo systemctl restart sshd

或者

sudo  ~/ssh/authorized_keys
添加你本机的公钥到该文件中

注意:
如果你喜欢用root用户登入的话,要确保

/etc/ssh/sshd_config
PermitRootLogin yes