此代碼有什麼問題?快速RSYNC代碼更正
sudo -u replicant rsync -av -e "ssh -o 'StrictHostKeyChecking no' -i /home/replicant/.ssh/id_rsa" --exclude 'media/' --exclude 'var/' --exclude '.svn' [email protected]$ADMIN:/var/www/ /var/www/ &> /tmp/rsync
if
[ $? -ne 0 ]; then
echo "date
: Error rsync'ing code base from $ADMIN check /tmp/rsync" | mail -s "Rsync error!" $DEVEMAIL
echo "date
: Error rsync'ing code base from $ADMIN check /tmp/rsync" >> $LOGFILE
echo "[email protected]$ADMIN:/var/www /var/www" >> $LOGFILE
exit
fi
我不斷收到此錯誤:
Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(605)
[Receiver=3.0.9]
請幫助。謝謝。
有人嗎?請。 – user1527556
延遲迴復,但聽起來您的SSH密鑰未被遠程服務器接受,請檢查它是否是正確的公鑰,並且它可以被複制用戶讀取 –