This article covers:
- How to add new SSH user to your Google Cloud VPS
This article is suitable for:
- Google Cloud VM Instance
- OS: Ubuntu 18.04
- SSH clients: Putty, Pageant
Step 1 – Generate Public/Private Key Pair
ssh-keygen -b 2048 -t rsa -f filename
Step 2 – Add Public Key
Download your public and private pair to your PC. Open public key, copy and paste it into your VM instance under Metadata -> SSH Keys.
Step 3 – Convert Private Key
If you use Pageant to load your private keys, the one you just generated won’t work for Pageant. You need to use PuttyGen to load it and save it as .ppk format, then you should be able to load this key into Pageant and use Putty to access your VM instance.
Step 4 – Change the Login User Name
When you generate public/private key pair in your VM instance, it will default the user name to your current SSH user name. You can change it by scrolling to the end of your public key and change the SSH user name:
ssh_username@yourhostname