After log in serial console on GCP VM Instance, It asked login credential

3,932 views
Skip to first unread message

smlee1976

unread,
Feb 10, 2019, 6:55:41 PM2/10/19
to gce-discussion
Hi All,

Please let me know which credential needs to logon via serial console on GCP VM Instance.

serial console.png

ama...@google.com

unread,
Feb 11, 2019, 4:21:23 PM2/11/19
to gce-discussion

Hi


Thank you for posting your question to Google Cloud Platform support. I can see that you’re attempting to SSH using Google Cloud Shell to your CentOS 7 environment and it is asking you for the password for your user “webserver”.


If you have SSH access:


Before you attempt to serial in your virtual machine, you need to set up a password for your root user via regular SSH or with a command sudo passwd $USER. Once you attempt to use serial connection, you must enter your username or “root” as the user, and then their password.


If you don’t have SSH access:


If you don’t have a root password for the serial console, you could use a startup script to add it to your instance, the script would be like this:


1. Go to the VM instances page in Google Cloud Platform console.

2. Click on the instance for which you want to add a startup script.

3. Click the Edit button at the top of the page.

4. Click on ‘Enable connecting to serial ports

5. Under Custom metadata, click Add item.

6. Set 'Key' to 'startup-script' and set 'Value' to this script:


#! /bin/bash
useradd -G <an existing group in the instance> USERNAME
echo USERNAME:PASSWORD' | chpasswd


  • Note. You can find a possible existing group in the project metadata. You can see the login ID you have in this instance.


7. Click Save and then click RESET on the top of the page. You might need to wait for some time for the instance to reboot.

8. Click on 'Connect to serial port' in the page.

9.  In the new window, you might need to wait a bit and press on Enter of your keyboard once; then, you should see the login prompt.

10. Login using the USERNAME and PASSWORD you provided.


Let me know if that helps.




On Sunday, February 10, 2019 at 6:55:41 PM UTC-5, smlee1976 wrote:
Reply all
Reply to author
Forward
0 new messages