How to add public key to remote host

copy public key

cat keyname_pub.key | ssh user@host ‘cat >> ~/.ssh/authorized_keys’

on local machine edit /home/username/.ssh/config and add

Host choose_short_name
HostName 192.168.7.21
Port 22
User remote_user
IdentityFile /home/username/username_ssh_priv.key

2017-01-23T11:37:21+00:00