Setting up password-less ssh on CentOS
Posted: April 28, 2017 Filed under: Uncategorized Leave a commentFirst set the hostname on both machines:
hostnamectl status
hostnamectl set-hostname newhostname
Add both hostnames to /etc/hosts on both machine
On source machine:
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
On target machine:
restorecon -Rv ~/.ssh
ssh remote-host