How to rename KVM virtual machine (VM) domain with virsh command

To rename a KVM virtual machine (VM) domain using the virsh command, you can follow these steps: Check the name of the virtual machine: sudo virsh list –all Shut down the virtual machine: sudo virsh shutdown <old-vm-name> where <old-vm-name> is the current name of the virtual machine. Rename the virtual machine: sudo virsh dominfo <old-vm-name> … Read more

How to add disk image to KVM virtual machine with virsh command

To add a disk image to a KVM virtual machine using the virsh command, you can follow these steps: Attach the disk image to the virtual machine: sudo virsh attach-disk <vm-name> <disk-image-path> <target-dev> –subdriver qcow2 –cache none –persistent where <vm-name> is the name of the virtual machine, <disk-image-path> is the path to the disk image … Read more

How to disable ssh password login on Linux to increase security

To disable password authentication for SSH on Linux, follow these steps: Open the SSH configuration file: sudo nano /etc/ssh/sshd_config Find the line that says: #PasswordAuthentication yes Uncomment the line by removing the # character and change yes to no. It should look like this: PasswordAuthentication no Save the file and exit the editor. Restart the … Read more

How to install Ansible on MacOS using CLI

To install Ansible on MacOS using the command line interface (CLI), you can use the Homebrew package manager. Here are the steps to install Ansible using Homebrew: Install Homebrew, if it’s not already installed on your MacOS system: /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)” Install Ansible using Homebrew: brew install ansible Verify the installation by checking … Read more

How do I determine RHEL (Red Hat Enterprise Linux) version?

There are several ways to determine the version of Red Hat Enterprise Linux (RHEL) you are using: Using the lsb_release command: lsb_release -a The output will include a line indicating the distribution name and version, for example: Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 7.8 (Maipo) Using the /etc/redhat-release file: cat /etc/redhat-release … Read more

How to install and configure Varnish cache on Ubuntu Linux 16.04 LTS

Here are the steps to install and configure Varnish cache on Ubuntu 16.04 LTS: Install Varnish: sudo apt-get update sudo apt-get install varnish Edit the default Varnish configuration: sudo nano /etc/default/varnish Change the DAEMON_OPTS variable to listen on port 80: DAEMON_OPTS=”-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m” Configure … Read more