How to Add New SSH User in Google Cloud VM Instance

No Comments

This article covers:

  1. How to add new SSH user to your Google Cloud VPS

This article is suitable for:

  1. Google Cloud VM Instance
  2. OS: Ubuntu 18.04
  3. 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

To many, a business is a lifetime commitment. It's easy to start one yet difficult to make it successful. Attitude, skills, experiences and dedication help hone the craft along the way, but it's often the great vision and resilience to remain focused wins the game. Read more about me here

More from Our Blog

See all posts