ssh-keygen creates the public and private keys. ssh-copy-id copies the local-host’s public key to the remote-host’s authorized_keys file. ssh-copy-id also assigns proper permission to the remote-host’s home, ~/.ssh, and ~/.ssh/authorized_keys.
Scenario is i want to ssh to remote-host (192.168.0.16) from my local-host (192.168.0.14)
The steaps are
1. Create public and private keys using ssh-key-gen on local-host (you do in local-host)
2. Copy the public key to remote-host using ssh-copy-id (you do in local-host)
3. Try ssh without password to remote-host(192.168.0.16) from local-host(192.168.0.14)
Why do we need ssh without login?
We need ssh without login for processes which run on background, such as transfer patch file during auto patching, auto remote synchronization to remote machine, etc.