21.7.21

How to Stop and Disable Firewall on CentOS 8

How to Stop and Disable Firewall on CentOS 8

Most of the time this task is done by system admins but if you work in a small organization like me(God helps you) :) then you need to do many system admin tasks by yourself.


I am writing this blog because recently faced issue similar issue when we moved one of the 19C databases to Azure cloud. After setting up the database application team was not able to reach the database. I did some checking and found that the Linux admin missed disabling the firewall on the DB server. So I decided to stop the firewall on DB server by myself.  


Sharing steps with you all, so may help you on "How to Stop and to Disable Firewall on CentOS 8"


There may be many methods but I used firewall-cmd to stop the firewall.


Man Page DESCRIPTION for firewall-cmd

NAME

       firewall-cmd - firewalld command line client

SYNOPSIS
       firewall-cmd [OPTIONS...]

DESCRIPTION

       firewall-cmd is the command-line client of the firewall daemon. It provides an interface to manage the runtime and permanent configurations.

       The runtime configuration in firewalld is separated from the permanent configuration. This means that things can
       get changed in the runtime or permanent configuration


Note: You need the root user or any user to have SUDO to do this change.

Steps to top and Disable Firewall on CentOS 8:- 

1. Check the Status of the firewall using Firewalld

[root@TEST-D01 ~]# firewall-cmd --state
                                     running
   
2.  Stop firewall using Firewalld

[root@TEST-D01 ~]# systemctl stop firewalld

3. Check the Status of firewall using Firewalld

[root@TEST-D01 ~]# firewall-cmd --state
not running

Keep Sharing :)


13.7.21

How to Change the Timezone in Linux

How to Change the Timezone in Linux

Easy steps to change timezone on "CentOS Stream release 8"

It's very simple to change the timezone of Linux machines. Sometimes as DBA you need to change the timezone on cloud environments when you handling multiple sites on the cloud.

Just follow the below steps to "Change the Timezone in Linux" :-

1) login with root or any sudo user to your machine and check current timezone. 
   [root@TEST-D01 ~]# timedatectl
                                       Local time: Tue 2021-07-13 03:40:06 EEST
                                       Universal time: Tue 2021-07-13 00:40:06 UTC
                                         RTC time: Tue 2021-07-13 00:40:06
                                        Time zone: Europe/Kiev (EEST, +0300)
                                     System clock synchronized: no
                                      NTP service: n/a
                              RTC in local TZ: no

My Current timezone is "Europe/Kiev (EEST, +0300)". 

So Let's change the timezone to Asia. 

2) You can get the list of all timezones in Asia by "timedatectl list-timezones |grep Asia" 
                    [root@TEST-D01 ~]# timedatectl list-timezones |grep Asia
                        Asia/Aden
                        Asia/Almaty
                        Asia/Amman
                        Asia/Anadyr
                        Asia/Aqtau
                        Asia/Aqtobe
                        Asia/Ashgabat
                        Asia/Atyrau
                        Asia/Baghdad
                        Asia/Bahrain
                        Asia/Baku
                        Asia/Bangkok
                        Asia/Barnaul
                        Asia/Beirut
                        Asia/Bishkek
                        Asia/Brunei
                        Asia/Chita
                        Asia/Choibalsan
                        Asia/Colombo
                        Asia/Damascus
                        Asia/Dhaka
                        Asia/Dili
                        Asia/Dubai
                        Asia/Dushanbe
                        Asia/Famagusta
                        Asia/Gaza
                        Asia/Hebron
                        Asia/Ho_Chi_Minh
                        Asia/Hong_Kong
                        Asia/Hovd
                        Asia/Irkutsk
                        Asia/Jakarta
                        Asia/Jayapura
                        Asia/Jerusalem
                        Asia/Kabul
                        Asia/Kamchatka
                        Asia/Karachi
                        Asia/Kathmandu
                        Asia/Khandyga
                        Asia/Kolkata
                        Asia/Krasnoyarsk
                        Asia/Kuala_Lumpur
                        Asia/Kuching
                        Asia/Kuwait
                        Asia/Macau
                        Asia/Magadan
                        Asia/Makassar
                        Asia/Manila
                        Asia/Muscat
                        Asia/Nicosia
                        Asia/Novokuznetsk
                        Asia/Novosibirsk
                        Asia/Omsk
                        Asia/Oral
                        Asia/Phnom_Penh
                        Asia/Pontianak
                        Asia/Pyongyang
                        Asia/Qatar
                        Asia/Qostanay
                        Asia/Qyzylorda
                        Asia/Riyadh
                        Asia/Sakhalin
                        Asia/Samarkand
                        Asia/Seoul
                        Asia/Shanghai
                        Asia/Singapore
                        Asia/Srednekolymsk
                        Asia/Taipei
                        Asia/Tashkent
                        Asia/Tbilisi
                        Asia/Tehran
                        Asia/Thimphu
                        Asia/Tokyo
                        Asia/Tomsk
                        Asia/Ulaanbaatar
                        Asia/Urumqi
                        Asia/Ust-Nera
                        Asia/Vientiane
                        Asia/Vladivostok
                        Asia/Yakutsk
                        Asia/Yangon
                        Asia/Yekaterinburg
                        Asia/Yerevan

Now We have the list of all timezones in Asia. Let's set it e.g. to Asia/Qatar.

3. To change the timezone from Europe/Kiev to Asia/Qatar. just run 

[root@TEST-D01 ~]# timedatectl set-timezone Asia/Qatar
[root@TEST-D01 ~]# timedatectl
               Local time: Tue 2021-07-13 04:02:48 +03
           Universal time: Tue 2021-07-13 01:02:48 UTC
                 RTC time: Tue 2021-07-13 01:02:49
                Time zone: Asia/Qatar (+03, +0300)
System clock synchronized: no
              NTP service: n/a
          RTC in local TZ: no