• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Search

Archives for August 2023

Install Pint on SLES

August 28, 2023

How to install pint utility on SLES machines.

zypp in python-susepubliccloudinfo

zypp in python-susepubliccloudinfo

Once installed, you can run

pint amazon servers –region='us-east-1'
pint google servers –region='us-central1'
pint microsoft servers –region='eastus'

pint amazon servers –region='us-east-1' pint google servers –region='us-central1' pint microsoft servers –region='eastus'

Filed Under: Cloud, Linux Tagged With: amazon, azure, google, pint, sles, smt

Capture GCP VM Serial Port Output to Terminal

August 28, 2023

Here’s the command to capture a GCP VM serial port output to your terminal.

gcloud compute instances get-serial-port-output servername \
--zone us-central1-f \
--project your-project \
--port 1

gcloud compute instances get-serial-port-output servername \ --zone us-central1-f \ --project your-project \ --port 1

You can also send the output to a file.

gcloud compute instances get-serial-port-output servername \
--zone us-central1-f \
--project your-project \
--port 1 > output.txt

gcloud compute instances get-serial-port-output servername \ --zone us-central1-f \ --project your-project \ --port 1 > output.txt

Filed Under: Cloud, Linux Tagged With: file, gcp, output, send, serial port, terminal

GCP VM Breakglass SSH

August 28, 2023

When you exhausted all efforts trying to login to a VM and there’s no other way to log in to the server, here’s a breakglass method to allow you to log in to a VM via a startup script. Just add the following bash script to the VM startup section. Change the username and password to your liking. Restart the server to trigger the startup script. After reboot, it should give you access to the server. In addition, you will also have sudo access so you can switch as root.

1. Edit the VM.
2. Go to the Startup script section and add the following.

#!/bin/bash
user="johndoe"
pass="password"
if id $user >/dev/null 2>&1; then
    exit
else
    adduser 
    echo $user:$pass | chpasswd
    usermod -aG google-sudoers $user
fi

#!/bin/bash user="johndoe" pass="password" if id $user >/dev/null 2>&1; then exit else adduser echo $user:$pass | chpasswd usermod -aG google-sudoers $user fi

3. Restart the server.
4. Log in as user.
5. Fix the login issue.
6. Remove user.
7. Remove the startup script.

Filed Under: Cloud, Linux Tagged With: breakglass, gcp, ssh, vm

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to Next Page »
  • Home
  • About
  • Search

Copyright © 2023