ITPub博客

首页 > Linux操作系统 > Linux操作系统 > How to Rsync over SSH without a password

How to Rsync over SSH without a password

原创 Linux操作系统 作者:andyxu 时间:2011-01-13 08:11:10 0 删除 编辑
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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-06-26

  • 博文量
    167
  • 访问量
    294802