8/20/20

Simple way to Boot up CentOS 7 / RHEL 7 in single user mode

The simplest way I found to boot up CentOS or RHEL version 7 is as follows:

  • Boot up or reboot your server
  • Choose the desired kernel from the Grub boot loader menu by moving with your keyboard's arrow keys
  • Press "e" (for Edit ) on your keyboard then scroll down the lines till you see the line that begins with "linux16" word
  • Navigate to the end of the line and type “rd.break” at end of the line
  • Hold down "Ctrl+x" to boot up that kernel you just edited


  • Once booting up is finished, you should see a message saying "Entering Emergency Mode" and you should be presented with a shell prompt 
  • Remount /sysroot in ‘rw’ mode with the following commands:
    • switch_root:/# mount -o remount,rw /sysroot
    • switch_root:/# chroot /sysroot


  • Once mounting the fs is done successfully,  you can proceed with whatever the reason was for booting in Single user mode, like checking/fixing partitions, resetting root's password, disabling/enabling service, etc..
Once you are finished doing what you need to do while in Single User Mode, type exit or hold down the "Ctrl+d" keys to exit that shell, then reboot your system your usual way like shutdown -r now or reboot etc..

That's all.


8/5/20

PowerShell Solution for the trust relationship between this workstation and the primary domain failed

This is one possible solution for the error of 

trust relationship between this workstation and the primary domain failed

Note the solution will be using powershell run as an admin.

First you need to get an idea of when the user computer/workstation domain password was last synchronized. So I ran the following Powershell command:

get-adcomputer -Identity ProblematicComputerName -Properties PasswordLastSet
Which should give you a result like the following. Note the the only entry we care about is the PasswordLastSet field shown in the redbox here:
 


Next step is to reset that machine account password as a domain admin to fix that trust relationship without having to disjoin and rejoin the domain.

This is accomplished by running the following PowerShell command on the affected machine. Note that you have to run Powershell as admin here as well:
Reset-ComputerMachinePassword -Server dc1.your.domain.com -Credential domain\adminusr
Once you click or hit your Enter key to execute the command, you should get a prompt to enter your admin password. So fill-in your domain admin password and click OK.
Assuming all was done correctly, you should be returned to your PowerShell prompt.

So now you need to re-run your the first command to see the result of your command. So wait a minute for the command to synch across your DCs (assuming you have more than one DC) and re-run the command:

get-adcomputer -Identity ProblematicComputerName -Properties PasswordLastSet
and you should get an updated PasswordlastSet field value:



PowerShell Command reference:

Quick HTTP to HTTPS - Apache2

There are several methods for redirecting your Apache-based website visitors who might type your servers URL using the plain (non-secure) HT...