Tuesday, December 13, 2005

Rsync: certification authentication on unix

1) use rsync over ssh to copy files between systems
rsync -av -e ssh src:/dir/* dest:/dir

2) use rsync over ssh and use public key for user authentication
(login from host A to host B without password authentication)
1) on host A generate private/public key pair
ssh-keygen -t rsa -b 2048 -f ~/.ssh_key/A-rsync-key
2) copy A-rsync-key.pub file to host B:~/.ssh/authorized_keys file
(use sshd_config to determine the location of this file)
3) create "config" file in A:~/.ssh as
Host B
User root
Compression yes
Protocol 2
RSAAuthentication yes
StrictHostKeyChecking no
ForwardAgent yes
ForwardX11 no
IdentityFile /.ssh_key/A-rsync-key

0 Comments:

Post a Comment

<< Home