You are here

Rsync with ssh and no passwd

Para poder hacer el rsync por ssh

Crear las claves en las 2 maquinas:

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/w0per/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/w0per/.ssh/id_rsa.
Your public key has been saved in /home/w0per/.ssh/id_rsa.pub.
The key fingerprint is:
39:33:0b:7c:2c:ba:17:c1:69:a5:bb:35:f

Tenemos que copiar la clave pública de pomelos en el authorized_keys de nisperosp

En pomelos:
cd .ssh
$ ls
id_rsa id_rsa.pub known_hosts prng_seed
$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvK9nhox082oS/tfHNY/Sk7TC3B+IetAUQldDa7Reg0qYZK/vb5H5yh1bvRE3wwgIh30qCTHrXqnhkKZ2JI//elMAN3zI7ad7uYbQDfEwB0sSgv6oyXDXPiBscWdbrisQMGawTygEUSLS9WmpeOiXV7P7nRZV4VVMrLkQAtEIoIM= w0per@pomelos

En la raid:
$ cd .ssh
$ ls
authorized_keys id_rsa.pub prng_seed
id_rsa known_hosts
$ vi authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAvK9nhox082oS/tfHNY/Sk7TC3B+IetAUQldDa7Reg0qYZK/vb5H5yh1bvRE3wwgIh30qCTHrXqnhkKZ2JI//elMAN3zI7ad7uYbQDfEwB0sSgv6oyXDXPiBscWdbrisQMGawTygEUSLS9WmpeOiXV7P7nRZV4VVMrLkQAtEIoIM= w0per@pomelos

Probamos con un ssh que conectamos sin contraseña, de pomelos a nisperos:

$ ssh nisperosp
Last unsuccessful login: Thu Nov 29 10:54:57 2007 on /dev/pts/1 from eeww
Last login: Thu Apr 3 16:50:20 2008 on /dev/pts/1 from wwee
$ exit
logout

y ya podemos usar rsync sin contraseña:

$ /usr/local/bin/rsync -avtz --progress --rsh="ssh" . nisperosp:/home/w0per
building file list ...
12 files to consider
.sh_history
3062 100% 2.25MB/s 0:00:00 (xfer#1, to-check=6/12)
.ssh/prng_seed
1024 100% 333.33kB/s 0:00:00 (xfer#2, to-check=1/12)

sent 1443 bytes received 98 bytes 56.04 bytes/sec
total size is 7490 speedup is 4.86

Unix Systems: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.

Fatal error: Class CToolsCssCache contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (DrupalCacheInterface::__construct) in /homepages/37/d228974590/htdocs/sites/all/modules/ctools/includes/css-cache.inc on line 52