ssh-copy-id -i ~/.ssh/mykey.pub user@host
nano ~/.ssh/authorized_keys
#then add your public key in the end (new line pls)
ssh-copy-id -i $HOME/.ssh/id_rsa.pub user@server1.cyberciti.biz
#To have access of your local machine to a server
#You need to do the following steps
#1: Create the key pair on your system by following command
eval $(ssh-agent -$)
ssh-keygen
it'll then ask you to enter the file name(required) and
enter phrase(optional), complete this process and you'll
have the key pair private and public file
#2: Take file.pub's key and put it in server's authorized_keys
(Authorized_keys file will be in your user's .ssh folder)
#3: On your local machine enter following again:
eval $(ssh-agent -$)
ssh-add /path/to/private-key-file
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDD3889tTsdyhHAakHJk3tIEwlFL6cL4i7XVBkOq+bvlvXyM+rzH+ZVpBUn8JBTjsACPkZvag4lR82qDlG2l4PKvDuUuGZVu5BIcAvUrVNroD8fs03eAuYme2oIfY8UHObzlXwsIOHMktJTs/EagHKuhW4ku+MxBdnX4a1gGIFj8zVL80yyJg7JAtlZtDe/wxKiHqCMb+tejtneYWHnHQBn0kv8tkr1LsodF1M6JVuYjF5V8cThN73PE6luOCa9AmZej0s0/oLprmINbyg+8Nk0JwqwkPiZvox+8m1o4ww02fhXuDRvapgku61/zgzbsGoBBDVaXdUsfWHObVblg4/0AujJWl20/qXAZkGDXgJ574ud0bFcgNJ2FVT9BzJDzxd46SQnDTelWr/jx5DY6sdsUH+VxFHC6SfzXWiSYLauDWTstWdIzxPy78RZ/9nDsavelLVNHahzhB7/T6qDTwSdCoDIrq3Jg69r1hda1CfSG27t4naSWMjEAZd4B3UEBMM= root@99153e607ab3