Friday 18 October 2019

Install Mariadb/Mysql 10.3 on centos8

yum install mariadb mariadb-server

systemctl enable mariadb

systemctl start mariadb

Tuesday 17 September 2019

sync/change/update time with NTP server on windows

net stop w32time

w32tm /config /syncfromflags:manual /manualpeerlist:"time.windows.com, 0.us.pool.ntp.org,1.us.pool.ntp.org,2.us.pool.ntp.org,3.us.pool.ntp.org"

w32tm /config /reliable:yes

net start w32time

w32tm /query /configuration


Friday 30 August 2019

update to kernel 5.2 on linux centos7

Note: Take a snapshot  before doing kernel update.

1. Install binaries required to compile Kernel

yum install gcc ncurses-devel make bc bison flex elfutils-libelf-devel openssl-devel grub2 -y

2. Download the latest kernel from https://kernel.org and extract it

curl -O https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.2.11.tar.xz

tar -xf linux-5.2.11.tar.xz


3. Copy the current Kernel configuration (.config) from the /boot to /root/linux-5.2.11

cp /boot/config-3.10.0-862.el7.x86_64 /root/linux-5.2.11

make menuconfig

save and exit





4. Make kernel and install

make
make install

5. Reboot

Thursday 22 August 2019

Linux root password hack

linux root password hack(Centos7, Redhat 7, Debian)

1. press any key to hold on to grub screen

2. press "e" to edit the grub file

3.a  add "rd.break" at end of the kernal line
3.b add init=/bin/bash   for debian of the linux line

4. press Ctrl+X

5a. mount -o remount,rw sysroot
5b. mount -o remount,rw / (for debian)

6.  chroot sysroot

7. passwd

8. touch /.autorelabel

9. reboot


Why   mount -o remount,rw sysroot ?
- When system boots in the single user mode the file system are in read-only mode. we cannot change the password in read only mode because these changes needs to be written in /etc/shadow file.

Why touch /.autorelabel?
- Relabel the filesystem for SElinux automatically.

Saturday 29 June 2019

Server hardening linux

Server harding is a process to make system secure and manageable.

for example.

  1. root login disable on ssh
  2. set password in single usermode
  3. removing unwanted kernal module
  4. enforcing SELinux
  5. remote login warning banner
  6. apply security patches
  7. Disable xinetd service
  8. unwanted network port blocked
  9. Enable audit logs
  10. logging is configured
Steps for hardening : https://www.cisecurity.org/cis-benchmarks/

Sunday 3 February 2019

install/run dotnet core on linux - Centos 7

1 . Install dotnet core, sdk https://dotnet.microsoft.com/download

2. 
rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
yum update
yum install aspnetcore-runtime-2.2
yum install dotnet-sdk-2.2


Run app:

dotnet coretest.dll --urls "http://*:80;"


Hosting on Nginx : https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.2

Hosting on Apache : https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-apache?view=aspnetcore-2.2