Skip to main content

Posts

Showing posts from July, 2019

Difference between SSH and SSL

SSH vs SSL The internet has opened a lot of doors, and windows as well. You can essentially do anything with internet nowadays. People can buy and do transactions online. You can reboot any  computer  system or program in your office from your personal computer. People do not even have to leave their homes anymore. Since there are lot of open doors and windows, hackers and eavesdroppers can illegally  get  personal  information  and have access to your personal program and files. Therefore, people now demand  web  security. Enter  SSH  and SSL. Both are public key cryptography tunneling protocols and aims to create a secure, confidential exchange of  data  and connection across the network particularly, the internet. The encryption technologies used by both protocols are very reliable, and it is extremely difficult or impossible for hackers to break into them. SSH SSH means “Secure Shell”. It has a built-in  username/password authentication   system  to establish a connectio

Boot process hangs at dracut: Switching root

Environment Red Hat Enterprise Linux 6 Issue When server is booting the boot process hangs at  dracut: Switching root , and never displays anything else. Raw device-mapper: ioctl: 4.33.1-ioctl (2015-8-18) initialised: xx-xxxx@redhat.com udev: starting version 147 dracut: Starting plymouth daemon dracut: rd_NO_DM: removing DM RAID activation dracut: rd_NO_MD: removing MD RAID activation scsi0 : ata_piix scsi1 : ata_piix ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc120 irq 14 ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc128 irq 15 Refined TSC clocksource calibration: 2599.999 MHz. virtio-pci 0000:00:03.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, high) -> IRQ 11 virtio-pci 0000:00:05.0: PCI INT A -> Link[LNKA] -> GSI 10 (level, high) -> IRQ 10 virtio-pci 0000:00:07.0: PCI INT A -> Link[LNKC] -> GSI 11 (level, high) -> IRQ 11 virtio-pci 0000:00:08.0: PCI INT A -> Link[LNKD] -> GSI 11 (level, high) -> IRQ 11 input: ImExPS/2 Gener

How to mount a non root filesystem early in the boot process

Environment Red Hat Enterprise Linux 7 Issue I would like to mount a non root filesystem early in the boot process Resolution Create  /etc/fstab.sys Raw # vi /etc/fstab.sys UUID="71be1001-d764-4505-a225-30d4771833f5" /mnt/test xfs defaults 0 0 fstab.sys  uses the same syntax style as  /etc/fstab Rebuild  initramfs Raw # dracut -f Reboot Raw # reboot Root Cause The  dracut fstab-sys  module allows the ability to load a seperate  fstab  into the initramfs which can allow the ability to load a file system earlier in the boot process. /usr/lib/dracut/modules.d/95fstab-sys/module-setup.sh Raw #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh check() { test -f /etc/fstab.sys || [[ -n $add_fstab || -n $fstab_lines ]] } depends() { echo fs-lib } install() { [ -f /etc/fstab.sys ] && inst_simple /etc/fstab.sys inst_hook pre-pivot 00 &qu

How to get list of all the files which are touched by Red Hat Enterprise Linux during boot process?

Environment Red Hat Enterprise Linux 6 Issue How to get list of all the files which are touched by Red Hat Enterprise Linux during boot process? Resolution To get such a list,  stap  script is required. There is an attachment with this Solution which is a zip file containing two programs,  bootinit.sh  and  bootprobe2.1.stp  file in  stapscripts.zip  file. Extract them and use as following. Make sure one has installed  kernel-devel  and  kernel-debuginfo  package of the currently booted kernel, otherwise it won't work at all. Follow  section 2.1.  in the SystemTap Beginners Guide for the  systemtap  and  kernel-debug  installation - Run the test at 2.1.3 to verify the install. 1.  Create  /tmp/stap  and  /tmp/stap/data Raw # mkdir -p /tmp/stap/data 2.  Place  bootprobe2.1.stp  and  bootinit.sh  into  /tmp/stap  and make  bootinit.sh  executable. Raw # chmod +x /tmp/stap/boot* 3.  Edit  bootinit.sh  and change  exec /sbin/init 3  to  exec /sbin/init

/sbin/init & rc.sysinit

The  /sbin/init  Program The  /sbin/init  program (also called  init ) coordinates the rest of the boot process and configures the environment for the user. When the  init  command starts, it becomes the parent or grandparent of all of the processes that start up automatically on the system. First, it runs the  /etc/rc.d/rc.sysinit  script, which sets the environment path, starts swap, checks the file systems, and executes all other steps required for system initialization. For example, most systems use a clock, so  rc.sysinit  reads the  /etc/sysconfig/clock  configuration file to initialize the hardware clock. Another example is if there are special serial port processes which must be initialized,  rc.sysinit  executes the  /etc/rc.serial  file. The  init  command then runs the  /etc/inittab  script, which describes how the system should be set up in each  SysV init runlevel . Runlevels are a state, or  mode , defined by the services listed in the SysV  /etc/rc.d/rc