Archives January 2022

How to – use one dynamic portal for whitelisting and have it sync across an entire cluster

Dynamic Portal

How to – use one dynamic portal for whitelisting and have it sync across an entire cluster

This article will go over a method I have recently come up with in order to have your agents sign in through one dynamic portal and have their IP validated across all servers in the cluster.

Step 1 – Generate a SSH key

In your linux cli simply type “ssh-keygen” and just press enter for all default values with no password as shown below

ssh-keygen
ssh-keygen

Step 2 – copy the ssh key to the other servers you need it synced to

ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.121 (replace IP with the servers Ip’s as you do each one)

Type yes and then enter the servers root password, do these steps for each server in your cluster

ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.80.121

Step 3 – rsync the Dynamic IP firewall list to the other servers

Replace the IP’s with each one in your cluster and repeat this step for each

  • Vicibox9 users use this command: /usr/bin/rsync -a -e “ssh” /tmp/VB-DYNAMIC-tmp root@192.168.80.121:/tmp/
  • Vicibox10 users use this one: /usr/bin/rsync -a -e “ssh” /tmp/dynamiclist-add-tmp root@192.168.80.121:/tmp/
/usr/bin/rsync -a -e “ssh” /tmp/dynamiclist-add-tmp root@192.168.80.121:/tmp/

Step 4 – Now add a cronjob to have this done every minute with one line for each server as shown below

  • ###Dynportal Sync
  • * * * * * /usr/bin/rsync -a -e “ssh” /tmp/dynamiclist-add-tmp root@192.168.80.120:/tmp/
  • * * * * * /usr/bin/rsync -a -e “ssh” /tmp/dynamiclist-add-tmp root@192.168.80.121:/tmp/

That’s all there is to it, now you can have your agents login through a single dynamic portal and sync it through to all servers in your cluster.

I hope this helps

Chris aka carpenox

How to migrate from CentOS 8 to AlmaLinux 8.5(conversion)

How to migrate from CentOS 8 to AlmaLinux (conversion)

I already wrote about migrating from CentOS 8 to Rocky Linux. Today, this quick post will list steps to convert existing VM or bare metal server from CentOS 8 to AlmaLinux 8.

WARNING! Make a backup before you start upgrading and the conversion procedure. I am an experienced Linux user, developer and sysadmin. However, there is no substitute for backups. Keep verified backups. Do not proceed further without backups. CyburDial is not responsible for data loss.

If you are doing this over an SSH session, I recommend running commands over GNU/screen or Tmux terminal multiplexer.

Migrating from CentOS 8 to AlmaLinux (conversion)

  1. Log in as the root user:
    sudo -i
  2. Apply pending updates to CentOS 8 by running the dnf command/yum command:
    dnf update

  • Apply pending updates before migration starts
  • Reboot the Linux box when new kernel updates are installed:
    reboot
  • After reboot, you need to download the almalinux-deploy.sh script using the wget or curl command, type:
    wget https://raw.githubusercontent.com/AlmaLinux/almalinux-deploy/master/almalinux-deploy.sh
    # read the script #
    vim almalinux-deploy.sh
  • Next set up executable permission using the chmod command, run:
  • chmod -v +x almalinux-deploy.sh
  • Downloading almalinux-deploy.sh script
  • Finally, migrate CentOS to AlmaLinux by typing the almalinux-deploy.sh:
    ./almalinux-deploy.sh
  • Migrating from CentOS 8 to AlmaLinux started
  • AlmaLinux migration tool in action
  • The upgrade and migration will take their own sweet time. It all depends upon your server hardware specification and the Internet speed. So wait and watch for errors on the screen. In the end, you should see a confirmation message as follows on screen:Complete! Run dnf distro-sync -y OK Restoring of alternatives is done OK Generating grub configuration file … done All Secure Boot related packages which were released by not AlmaLinux are reinstalledOK   Migration to AlmaLinux is completed
  • Reboot the Linux box hosted at AWS or Linode:
    shutdown -r now
    Connection to 3.1x.2xx.2xx closed by remote host.
  • Finally, verify the AlmaLinux version, run: cat /etc/redhat-release
    ## OR ##
    cat /etc/os-release
  • CentOS to Almalinux migration successfully executed
  • Also, make sure all services such as PGSQL, Apache and others are running using the ps command or ss command:
    ss -tulpn | more
    ss -tulpn | grep ":80"
    # Verify logs using the tail command and dmesg command+egrep command #
    tail -f /var/log/httpd/app_name_goes_here
    dmesg | egrep -i 'error|critical|warn'

This will convert your centos8 system over to AlmaLinux

Last step is to recompile dahdi:

cd /usr/src/dahdi-linux-complete-3.1.0+3.1.0/

make && make install

modprobe dahdi

dahdi_cfg -v (to check no errors)

I hope this helps

-Carpenox aka Chris