key-pairs configuation
ssh-keygen -t rsa -f <file path> -C [user name]
local configuation
Host XXXX
HostName XX.XXX.XXX.XXX
User XXXX
Port XXXX
Identityfile ~/.ssh/[YOUR KEY]
How to put public key to server?
Find authorized_keys
in ~/.ssh/
of server
Add public key in this file
....
....
# Added by Yukun
Your Public key..............
...............
...............
However, if we are using google cloud, authorized_keys will be recovered by daemon. Solution:Managing SSH keys in metadata. add ssh public key in metadata rather than modify authorized_keys file.