![如何使用在 LDAP 服务器上创建的帐户“rsync”在 Linux 服务器之间传输文件](https://linux22.com/image/711224/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%9C%A8%20LDAP%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E5%88%9B%E5%BB%BA%E7%9A%84%E5%B8%90%E6%88%B7%E2%80%9Crsync%E2%80%9D%E5%9C%A8%20Linux%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B9%8B%E9%97%B4%E4%BC%A0%E8%BE%93%E6%96%87%E4%BB%B6.png)
我有一个 LDAP 服务器,它有同步帐户。我想用它来SCP所有服务器之间的文件。我添加了同步用户/.ssh/authorized_keys文件并尝试SCP。错误如下:
[rsync@magdev2 fail2ban]$ scp jail.local [email protected]:/tmp
The authenticity of host 'abc.com (10.104.0.24)' can't be established.
ECDSA key fingerprint is 5a:7e:d8:ce:58:8b:45:27:56:ac:b8:be:d2:a9:9e:33.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'abc.avery.com,10.104.0.24' (ECDSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
lost connection
[rsync@magdev2 fail2ban]$
有什么方法可以实现这一点?
答案1
man ssh-keyscan
ssh-keyscan 是一个用于收集多个主机的公共 ssh 主机密钥的实用程序。它旨在帮助构建和验证 ssh_known_hosts 文件。ssh-keyscan 提供了一个适合 shell 和 perl 脚本使用的最小接口。