While you're trying to SSH to your VM instance from the Browser, click on the gear icon on top-right side of the SSH window, click on Change Linux Username
and enter that particular username which you mentioned you can use it to SSH to your VM instance through terminal.
If this works then the issue is that you're allowing only specific users to SSH to your VM instance.
When SSHing from the Browser, by default, a username for SSH sessions is generated from the email address logged into the account, omitting the domain information. For example, if an email is jane.doe@gmail.com
, the corresponding username would be jane_doe
.
Make sure the username generated from your email address logged into the account is allowed to SSH to your VM instance.