Commands to get DNS records:

To get A record.

# host -t a

Like wise use this command to get the CNAME, MX, SOA & NS (Name server) records.


Linux Server Hardening:


How to change the root password for Linux in single user mode:

If you forget the root password of the Linux system, it can be retrieved by  login to the single user mode.

1) Boot up your redhat system, on the boot up splash screen press and hold shift key until you enter the GRUB screen as show on figure below figure show red-hat boot screen, press and hold “shift” key here and wait until GRUB boot.

2) figure show Redhat GRUB boot menu screen, if you have multiple operating system installed, you may have to select the Redhat as show on figure below by using the ‘up’ and ‘down’ key… then hit the ‘e‘ key to enter GRUB editing mode.

3) Use the ‘up’ and ‘down’ key again, select the ‘Kernal /VMlinuz-2.6.9-22.EL ro root =LABEL=/ rhgb quiet” and the hit the ‘e‘ key again to edit the grub command line.

4) The below screen appear after you hit the ‘e‘ key, now notice that you mouse cursor at the end of line “Kernal /VMlinuz-2.6.9-22.EL ro root =LABEL=/ rhgb quiet”

5) Change at the end of the line that say ‘rhgb quiet‘ to ‘linux single‘ as show on the example below.

From : Kernal /VMlinuz-2.6.9-22.EL ro root =LABEL=/ rhgb quiet

To    :  Kernal /VMlinuz-2.6.9-22.EL ro root =LABEL=/ rhgb single

6) Hit ‘Enter’ key after finish enter the ‘rhgb single‘ at the end of kernel line, as show on GRUB screen above.

Hit the ‘b‘ key to boot the selected kernel and start the boot process to Linux single user mode.

7) After you hit the ‘b‘ key, the Redhat should reboot and then enter the single user mode and should give you root shell terminal without prompt any password field or ask for password.  The example below show the single user terminal screen.

Type to cmd “passwd” to change the root password.

[root@redhat/]# passwd

Changing password for user root.

New UNIX password:

BAD PASSWORD: it is too simplistic/systematic

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

Then reboot the system and start using the new root password for your redhat system.

[root@Redhat /]#reboot


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s