• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Archives for May 2021

GCP Instance Scheduler

May 28, 2021

GCP recently added Instance Schedule to its console.

To configure, perform the following.

– Create an instance schedule.
– Add instance(s) to a schedule.
– If no errors, the service account has the correct permissions.

The service account used by Instance Schedule is owned by GCP and is not visible in the GCP console.

If service account has no permissions, the you must perform the following.

– Create a custom role with compute.instances.start and compute.instances.stop permissions.
– Add custom role to the service account.

Finally, validate instances are starting and stopping based on schedule.

Filed Under: Cloud Tagged With: configuration, gcp, instance schedule, service account

Generated by NetworkManager

May 27, 2021

If your /etc/resolv.conf keeps getting overwritten, take a look at /etc/NetworkManager/NetworkManager.conf. Set DNS to none.

[main]
dns=none

[main] dns=none

Filed Under: Linux Tagged With: dns, generated, networkmanager, overwritten, resolv.conf

GCP Compute Enable OS Login

May 27, 2021

If you have trouble logging in (SSH) to your GCP instance, you may have to enable OS Login.

gcloud compute instances add-metadata server-name \
--metadata enable-oslogin=TRUE \
--zone us-central1-c \
--project project-id

gcloud compute instances add-metadata server-name \ --metadata enable-oslogin=TRUE \ --zone us-central1-c \ --project project-id

When done, you can set it back to FALSE.

Filed Under: Cloud Tagged With: compute, gcloud, gcp, login, os, true

GCP Display Serial Port in Shell

May 26, 2021

How to display serial port in GCP Cloud Shell.

gcloud compute instances get-serial-port-output instance-name \
--zone=us-central1-a \
--project=your-project-id

gcloud compute instances get-serial-port-output instance-name \ --zone=us-central1-a \ --project=your-project-id

Filed Under: Cloud Tagged With: cloud shell, console, gcp, serial port, terminal

Winbind Fix

May 24, 2021

Here’s the process to restore Winbind.

Restore old config.

cp /etc/sssd/sssd.conf-xxxxxxx /etc/sssd/sssd.conf
cp /etc/krb5.conf-xxxxxxx /etc/krb5.conf

cp /etc/sssd/sssd.conf-xxxxxxx /etc/sssd/sssd.conf cp /etc/krb5.conf-xxxxxxx /etc/krb5.conf

Disable SSSD. Authconfig creates /etc/nswitch.conf.

authconfig --disablesssd --disablesssdauth --updateall

authconfig --disablesssd --disablesssdauth --updateall

Start Winbind.

service winbind start; service smb start; service nmb start

service winbind start; service smb start; service nmb start

Filed Under: Linux Tagged With: disable, restart, restore, winbind

SSSD Report

May 24, 2021

Generate a SSSD report.

#!/bin/bash
log="log"
> $log
sep () { echo "--------------------------------" >> $log; }
sep
echo "SSSD Status" >> $log
sep
systemctl status sssd >> $log
sep
echo "Contents of /etc/resolv.conf" >> $log
sep
cat /etc/resolv.conf >> $log
sep
echo "Contents of /etc/sssd/sssd.conf" >> $log
sep
cat /etc/sssd/sssd.conf >> $log
sep
echo "Versions of /etc/resolv.conf" >> $log
sep
ls -l /etc/resolv.conf* >> $log
sep
echo "Versions of /etc/sssd/sssd.conf" >> $log
sep
ls -l /etc/sssd/sssd.conf* >> $log
sep
echo "Contents of /var/log/sssd-rollout.log" >> $log
sep
cat /var/log/sssd-rollout.log >> $log
sep
echo "Contents of /var/log/sssd-rollout3.log" >> $log
sep
cat /var/log/sssd-rollout3.log >> $log
sep

#!/bin/bash log="log" > $log sep () { echo "--------------------------------" >> $log; } sep echo "SSSD Status" >> $log sep systemctl status sssd >> $log sep echo "Contents of /etc/resolv.conf" >> $log sep cat /etc/resolv.conf >> $log sep echo "Contents of /etc/sssd/sssd.conf" >> $log sep cat /etc/sssd/sssd.conf >> $log sep echo "Versions of /etc/resolv.conf" >> $log sep ls -l /etc/resolv.conf* >> $log sep echo "Versions of /etc/sssd/sssd.conf" >> $log sep ls -l /etc/sssd/sssd.conf* >> $log sep echo "Contents of /var/log/sssd-rollout.log" >> $log sep cat /var/log/sssd-rollout.log >> $log sep echo "Contents of /var/log/sssd-rollout3.log" >> $log sep cat /var/log/sssd-rollout3.log >> $log sep

Filed Under: Linux Tagged With: generate, report, sssd, status

Remove SSSD package

May 24, 2021

How to remove SSSD package.

#!/bin/bash
service sssd stop
chkconfig sssd off
rm -rf /var/lib/sss/db/*
rm -f /etc/sssd/sssd.conf
rm -f /etc/krb5.conf
rm -f /etc/krb5.keytab
yum remove -y adcli sssd authconfig pam_krb5 samba4-common realmd

#!/bin/bash service sssd stop chkconfig sssd off rm -rf /var/lib/sss/db/* rm -f /etc/sssd/sssd.conf rm -f /etc/krb5.conf rm -f /etc/krb5.keytab yum remove -y adcli sssd authconfig pam_krb5 samba4-common realmd

Filed Under: Linux Tagged With: ad, remove, sssd

rpmdb open failed

May 22, 2021

If you get this error, something happened to the rpm database. To fix.

rm -f /var/lib/rpm/__db*
db_verify /var/lib/rpm/Packages
rpm --rebuilddb
yum clean all

rm -f /var/lib/rpm/__db* db_verify /var/lib/rpm/Packages rpm --rebuilddb yum clean all

Run yum again.

Filed Under: Linux Tagged With: failed, open, rebuild, rpmdb, yum

  • Go to page 1
  • Go to page 2
  • Go to Next Page »
  • Home
  • About
  • Archives

Copyright © 2023