Isto é para senha menos login.
Primeiro, crie uma chave id_rsa.pub
usando esse método
[max@localhost .ssh]$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/max/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/max/.ssh/id_rsa. Your public key has been saved in /home/max/.ssh/id_rsa.pub. The key fingerprint is: 93:24:83:37:eb:5e:13:97:d1:ea:bd:0a:d8:29:9f:ba [email protected] The key's randomart image is: +--[ RSA 2048]----+ | | | . . | | . = . . . | | . * . + | | . S + | | . o * . | | + * . . | | . + + . | | Eoo ... | +-----------------+
Compartilhe a chave id_rsa.pub
para o sistema remoto
Esta chave será apresentada no diretório .ssh/
do seu diretório pessoal
Usando este comando, você pode copiar a tecla id.rsa.pub
para o sistema remoto ([email protected]. *. *)
[max@localhost .ssh]$ ssh-copy-id -i id_rsa.pub [email protected].*.* The authenticity of host '10.10.*.* (10.10.*.*)' can't be established. RSA key fingerprint is 2b:bf:e1:e9:c6:76:b0:2d:a1:45:0f:2a:53:05:10:15. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '10.10.*.*' (RSA) to the list of known hosts. [email protected].*.*'s password: Now try logging into the machine, with "ssh '[email protected].*.*'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
Agora digite o comando rsync para copiar arquivos (para copiar automaticamente, escreva um crontab e escreva este comando)
Esta é a sintaxe de rsync
rsync [OPÇÃO ...] SRC ... [DEST]
[max@localhost .ssh]$ rsync -avz [email protected].*.*:/home/min/test /home/max/Desktop receiving incremental file list test sent 30 bytes received 89 bytes 79.33 bytes/sec total size is 0 speedup is 0.00