Tuesday, 15 August 2017

Secure boot loader (grub menu) with password in Centos 7/RHEL 7




Secure boot loader (grub menu) with password in Centos 7/RHEL 7

Below is the GRUB menu where we are planning to put the password so that no one logs in to single user mode without permission



As you can see by default anyone can press "e" and edit the grub menu to enter single user mode

Login as root and run the below command. When prompted, provide the grub password to be used
# grub-md5-crypt
Password:
Retype password:
$1$KYWqk1$cyrEcj8xXtctko70sSowx.
Next edit the GRUB configuration file /etc/grub.conf and add a new entry as shown below after timeout parameter in the main section.
password --md5 <password-hash>
Replace <password-hash> with the value returned by grub-md5-crypt above

# less /etc/grub.conf
default=0
timeout=5
password --md5 $1$KYWqk1$cyrEcj8xXtctko70sSowx.
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
Next time the system boots, the GRUB menu does not allow access to the editor or command interface without first pressing p followed by the GRUB password.

Reboot and verify the changes



So now it does asks for the password we had set.

Let me know your success and failures.

How to: - Fix PHPMyAdmin 403 Forbidden Error



When we install phpmyadmin using yum in RHEL7/Centos7. By default phpmyadmin installed under /usr/share/phpmyadmin and the apache configuration file is located in /etc/httpd/conf.d/phpmyadmin.conf.

How to: Disable the HTTP TRACE Method



Most vulnerability scanners will complain about TRACE method being enabled on the web server tested.

Monday, 14 August 2017

RHEL 7.3 Could not detect disk array partition while installation



Installing Red Hat Enterprise Linux 7.3 on HP Dynamic Smart Array B120I SATA RAID.

How to disable directory browsing in Apache/httpd?



How can we disable building of directory index in httpd? One of the most important settings in Apache to secure Apache web server is to disable directory browsing. To prevent the server from showing a listing of the existing files in case there is no index in one folder.
Usually Apache comes with this feature enabled but it’s always a good idea to get it disabled unless you really need it.

Saturday, 13 May 2017

LVM Resize – How to Increase an LVM Partition



In this tutorial we will work through extending logical volume /opt from 9.8 GB to appr.15 GB. We have added new hard disk of 10 GB.

Saturday, 10 December 2016

How to Check the lock status of any Linux Account



Now one single command to see the lock status of the user:

Tuesday, 29 November 2016

pam_tally2 command – lock & unlock ssh failed logins



Check users login attempts using pam_tally2 command: