username of google cloud instance - where to find out

user1700890 picture user1700890 · Dec 13, 2017 · Viewed 18.3k times · Source

My gmail account I used to create my google cloud instance is [email protected].

When I tried to connect to instance with WinSCP using "johnsmith" it failed, but it worked with "JOHN.SMITH"? Where can I find out my exact username for google cloud instance?

UPDATE. I tried web-based SSH and typed whoami, it returned "johnsmith". "john.smith" is my windows local username. It is all very confusing.

ANOTHER UPDATE: My google cloud instance is Ubuntu 16.04 and I am connecting from Windows 7 local machine

P.S. I made up the name, but preserved format for this question.

P.S.S SO does not let me post because I don't meet their standard. Here is some bogus code to meet the standard:

print("Hello, World!")

Answer

neilH picture neilH · Dec 14, 2017

Just to clarify, I presume you are trying to connect to a Compute Engine Windows Instance in your Google Cloud Platform project, is that correct?

In order to confirm the username of this instance I would recommend following these instructions:

1) Login to Google Cloud Platform Console at this link https://console.cloud.google.com/

2) In the Console main menu (the three horizontal stripes in the top left corner) navigate to 'Compute Engine' and then click on 'VM instances'.

3) You should now be able to see the name of your VM instance- click on it.

4) You will now be in the "VM instance details" screen.

Windows

5) If you now click on "Set Windows Password" a new pane will open that contains your username to login to the instance.

6) If you now press "Set" in the same window, you will receive your Windows password (copy or make note of this).

By using the username and password you retrieved in step 5 and 6 you will be able to access the instance.

You now also have the option of pressing "RDP" in the "VM instance details" page to gain access to your instance via RDP and change your username/password to something more memorable once you have access to the operating system.

Linux

Alternatively, if you are trying to disover the username of a Linux VM Instance, you can confirm this by accessing the machine via SSH from the Console. You will then be able to set the password of the machine.

To SSH into the machine, follow the same first 4 steps in the above instructions, then:

  • Click on "SSH". A new terminal window will open and you will gain access the machine.
  • You will be able to see your username in the shell, or alternatively you can type whoami in the shell and after pressing enter it will print out your username.
  • To set a password for the machine, type sudo passwd then press return. You will then be prompted to enter a new password.