add login in server by ssh key code example
Example 1: ssh add new key
$ eval "$(ssh-agent -s)"
> Agent pid 59566
Example 2: add public key to server
ssh-copy-id -i ~/.ssh/mykey.pub user@host
$ eval "$(ssh-agent -s)"
> Agent pid 59566
ssh-copy-id -i ~/.ssh/mykey.pub user@host