Linux rsync错误权限被拒绝
正在尝试将文件从一台服务器重新同步到另一台服务器,以获取Linux rsync错误权限被拒绝,linux,ssh,Linux,Ssh,正在尝试将文件从一台服务器重新同步到另一台服务器,以获取 ubuntu@xx-xxx-xx-xx-xx:~$ rsync -i "xxxxxXXX.pem" -anv webapps ubuntu@xx.xx.xxx.xx:/home/ubuntu/ Permission denied (publickey). rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexpla
ubuntu@xx-xxx-xx-xx-xx:~$ rsync -i "xxxxxXXX.pem" -anv webapps ubuntu@xx.xx.xxx.xx:/home/ubuntu/
Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.1]
我可以使用ssh-I“xxxxxxx.pem”将ssh连接到服务器ubuntu@xx.xxx.xxx.xx
密钥的权限为600
-rw------- 1 ubuntu ubuntu 1696 Feb 1 06:00 xxxxxxxx.pem
rsync
正在使用-i
开关来选择与ssh
不同的选项。如果需要为rsync
指定标识文件,请使用-e
开关直接向ssh
提供选项:
rsync -e "ssh -i xxxxxXXX.pem" -anv webapps ubuntu@xx.xx.xxx.xx:/home/ubuntu/
rsync
正在使用-i
开关来选择与ssh
不同的选项。如果需要为rsync
指定标识文件,请使用-e
开关直接向ssh
提供选项:
rsync -e "ssh -i xxxxxXXX.pem" -anv webapps ubuntu@xx.xx.xxx.xx:/home/ubuntu/