SSH com chaves sem senha

1 – Gere na máquina cliente as chaves pública e privada. Pressione enter para deixar sem senha

ssh-keygen

2 – Copie a chave pública gerada no cliente para o servidor, pedirá a senha do servidor

ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.0.1

2.1 – Caso não tenha o comando ssh-copy-id copie o conteúdo da chave pública .ssh/id_rsa.pub gerada na máquina cliente para o arquivo .ssh/authorized_keys no servidor.

cat /root/.ssh/id_rsa.pub | ssh root@192.168.0.1 'cat >> .ssh/authorized_keys'

3 – Teste o login sem senha

ssh root@192.168.0.1

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s