- Create a ssh-key in host machine
ssh-keygen -f ~/.ssh/blgnksy-key-rsa -t rsa -b 4096
- Add key to ssh
ssh-add ~/.ssh/blgnksy-key-rsa
- Copy the contents of public key file
ssh-copy-id -i ~/.ssh/blgnksy-key-rsa user@host
-
Make sure of permissions on remote
/home/user/.ssh 700
/home/user/.ssh/authorized_keys 600
/home/user 700