gentoo下的ssh key认证rsync同步

Standard

A:191.168.0.10
B:191.168.0.11
采用推送方式,由A将文件推送到B

A:

emerge rsync
 
cd
ssh-keygen -t dsa -b 1024 -f /root/this-host-rsync-key
cp this-host-rsync-* ~/.ssh
scp this-host-rsync-key.pub root@191.168.0.11:/root/.ssh/

B:

emerge rsync
 
cd
cd ~/.ssh/
cat this-host-rsync-key.pub > authorized_keys
 
vi /etc/rsyncd.conf
  uid = root
  gid = root
  max connections = 10
  pid file = /var/run/rsyncd.pid
  use chroot = yes
  read only = yes
  [rsynctest]
  path = /root/rsync_B
  comment = test
  ignore errors
  read only = no
 
/etc/init.d/rsyncd start

A:

rsync -vzrtopg --delete /root/rsync_A/ 172.28.201.102::rsynctest

转载请注明出处: http://yemaosheng.com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.