SSH sem senha: eu fazia da forma mais difícil possível até hoje e não sabia

Essa é a forma fácil.
O programa ssh-copy-id já vem no mesmo pacote (pelo menos em RHEL / OEL / CentOS) do cliente ssh.

[suporte@Gaspar bin]$ ssh-copy-id suporte@192.168.15.2
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/suporte/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
suporte@192.168.15.2's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'suporte@192.168.15.2'"
and check to make sure that only the key(s) you wanted were added.

[suporte@Gaspar bin]$ ssh suporte@192.168.15.2
Last login: Tue Jun  5 17:05:24 2018 from gaspar
[suporte@Baltazar ~]$

4 comments

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

This site uses Akismet to reduce spam. Learn how your comment data is processed.