Articles by Deepak Prasad
Ansible command vs shell vs raw Module: When to Use Each
Compare Ansible command, shell, and raw modules—pipes, argv, creates, removes, changed_when, Python bootstrap, security risks, and when to use dedicated modules instead.
What is Ansible? Architecture, Components and How It Works
Learn what Ansible is, how agentless automation works, and how control nodes, inventory, modules, playbooks, roles, collections, and vault fit together on Rocky Linux.
Ansible Operators and Jinja2 Tests in when Conditions
Learn Ansible comparison and logical operators, Jinja2 tests such as is defined, and safe when expressions for strings, lists, dictionaries, facts, and registered task results.
YAML Syntax for Ansible Playbooks with Examples
Learn YAML syntax for Ansible playbooks—indentation, lists, dictionaries, strings, booleans, multiline values, common mistakes, and ansible-playbook --syntax-check validation.
Ansible Facts and Custom Facts Explained
Learn Ansible facts from the setup module—OS, network, memory, mounts, and Python—plus fact filters, gather_facts control, custom facts.d files, and ansible_local in playbooks and templates.
Ansible Ad Hoc Commands Explained with Examples
Learn Ansible ad hoc command syntax with ping, command, shell, package, service, file, copy, user, become, --limit, check mode, troubleshooting, and playbook migration examples.
Ansible Roles Explained: Directory Structure, Defaults, Vars and Handlers
Learn Ansible roles with a tested demo: directory structure, tasks, handlers, defaults vs vars, variable placement, role dependencies, and when to use roles, include_role, or import_role.
Migrate an Existing LVM Root Filesystem to LUKS Online
Migrate an already-installed Ubuntu LVM root volume group onto a new LUKS2 physical volume with pvmove, then configure crypttab with initramfs, regenerate the initramfs, and update GRUB for boot-time unlock.
Enroll TPM2, FIDO2, and Recovery Keys on LUKS2 with systemd-cryptenroll
Use systemd-cryptenroll on LUKS2 volumes to add TPM2, FIDO2, PKCS#11, and recovery-key unlock methods, store token metadata in the LUKS2 JSON area, and wire boot unlock through crypttab.
How to Resize a LUKS Partition (Extend or Shrink) in Linux
Extend or shrink a LUKS2 ext4 volume on Linux: grow the partition first, run cryptsetup resize on the mapper, then resize2fs; for shrink, reverse the order with offline resize2fs and --size in 512-byte sectors.
How to Open and Unlock a LUKS Disk on Another Linux Machine
Unlock and mount a LUKS USB or moved disk on another Linux host: cryptsetup open by device, UUID=, or /dev/disk/by-uuid, ext4 or LVM inside LUKS, read-only rescue mount, and close the mapper.
Network-Bound Disk Encryption with Clevis and Tang on Linux
Configure LUKS NBDE with Clevis and Tang on RHEL/CentOS: two-VM lab with Tang server, LUKS root client, dracut rebuild, and video—boot without typing a passphrase when Tang is reachable.
How to Auto Mount and Unlock LUKS Encrypted Partitions at Boot
Configure crypttab and fstab to unlock and mount a secondary LUKS data partition at boot on Ubuntu or Debian.
How to Back Up and Restore a LUKS Header in Linux
Back up and restore a LUKS2 header with cryptsetup luksHeaderBackup and luksHeaderRestore, use a detached header file, and understand when a header copy cannot recover a forgotten passphrase.
Change LUKS Passphrase, Volume Key, and Cipher on Linux
Rotate LUKS passphrases and key slots, change cipher or volume key with cryptsetup reencrypt on LUKS2, and back up the header before destructive operations.
How to Encrypt a Disk Partition with LUKS in Linux
Encrypt a new Linux disk partition with LUKS2 using cryptsetup: partition the disk, run luksFormat, open the mapper, create ext4 on /dev/mapper, and mount the volume.
cryptsetup Command in Linux: LUKS2 Syntax, Options & Examples (Ubuntu)
cryptsetup manages LUKS disk encryption through the kernel dm-crypt device mapper. Use it to format partitions, open and close mapper devices, rotate passphrases, back up headers, and inspect LUKS2 metadata on Ubuntu and …
How to List Users in Linux (getent, passwd, who, id)
List users in Linux with getent, /etc/passwd, who, and id. Filter normal and system accounts, see logged-in sessions, and check whether a user exists on Ubuntu and RHEL.
How to View a Certificate with OpenSSL (PEM, CER, Chain, Bundle)
Use OpenSSL to view PEM, CRT, CER, chain, bundle, PFX, and P7B certificates. Check expiry, SAN, fingerprint, remote TLS certs, and verify chains.
How to List Groups in Linux and Check User Group Membership
List groups in Linux with getent, groups, id, and /etc/group. Check user group membership, list group members, and compare primary vs supplementary groups.
Set up Proxy using http_proxy, https_proxy and no_proxy in Linux
Learn how to configure http_proxy, https_proxy and no_proxy environment variables in Linux temporarily, permanently, system-wide, and for tools like curl, wget, apt, git and Docker.
Stop All Docker Containers: Commands, Examples, and Safe Shutdown
Stop all running Docker containers with docker stop $(docker ps -q), handle empty lists safely, adjust timeouts, force-kill stuck containers, filter by label, and shut down Compose stacks without data loss.
100+ Linux Commands Cheat Sheet (With Practical Examples)
A complete Linux commands cheat sheet with 100+ essential commands and practical examples. Learn file management, system monitoring, networking, permissions, and DevOps-related Linux commands used by administrators, …
How to Install Node.js on Ubuntu
Install Node.js on Ubuntu with apt nodejs, NodeSource setup scripts, NVM for multiple versions, or the official nodejs.org linux-x64 tar.xz under /opt, verify with node --version and npm --version, and uninstall per …
Automate keytool Certificate Import in Bash Safely
Back up a PKCS12 truststore, check the keytool alias and SHA-256 fingerprint, import a CA only when missing, and exit cleanly for Ansible, systemd, and CI pipelines.
Sign and Verify a JAR File with keytool and jarsigner
Create a code-signing keypair with keytool, sign a sample JAR with jarsigner, verify the signature, and read the PKIX chain warnings jarsigner prints for a self-signed certificate.
Create Java mTLS Keystore and Truststore with keytool
Create Java mTLS keystore and truststore files with keytool and OpenSSL, then run a mutual TLS HttpsServer lab that fails without a client cert and succeeds.
How to Configure Java javax.net.ssl.trustStore and keyStore Properties
Set javax.net.ssl.trustStore and keyStore JVM properties after building a PKCS12 file with keytool: property names, -D flags, JAVA_TOOL_OPTIONS, and a lab that fails without trustStore then succeeds.
How to Import Certificates into App-Specific Java Truststores
Fix PKIX after importing into the wrong cacerts. Find the Java truststore your app actually uses, including bundled JRE cacerts, and import with keytool.
Renew or Replace an Expired Certificate in an Existing Java Keystore
Renew an expired TLS certificate in an existing Java PKCS12 keystore by checking expiry with keytool -list -v, exporting a CSR from the same alias, and importing the CA-signed reply without deleting the private key.

