Howto Rsync over SSH without a password.
1. Log into the TARGET host, and generate an RSA (public and private) key pair:
* Accept the default location for the key files (press [ENTER]).
* Enter and confirm a pass phrase. (empty for no passphrase) (it is not a requirement)
target$ ssh-keygen -t rsa
2. Log into the SOURCE host:
source$ touch ~/.ssh/authorized_keys
3. Log into the SOURCE host, and get public key from TARGET:
source$ ssh target cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
4. Log into the TARGET host, and try to rsync:
target$ rsync -e ssh -av oracle@source:/ocfs_data/mxdell/arch/ /ocfs_data/mxdell/arch/
或
命令1:$ ssh-keygen -t rsa
命令2:$ scp /home/use/.ssh/id_isa.pub B:/home/user/.ssh/authorized_keys
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/110321/viewspace-683708/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/110321/viewspace-683708/