Run following command in your terminal (for windows, use git bash)
ssh-keygen -o
Enter a path to save the ssh key
/c/Users/farhad/.ssh/server_name
Note: Replace
server_name
with your convenient name.
Now copy the public key and upload in your server. (in case GCP, go to edit vm, and go to security and then save the key)
cat /c/Users/farhad/.ssh/server_name.pub
ssh -i ~/.ssh/server_name server_ip_address_here