linux

How to Check SSH Protocol Version: SSH1 vs SSH2 in OpenSSH

Learn how to check whether SSH is using protocol 1 or 2, what OpenSSH version strings such as OpenSSH_7.4p1 mean, and how to read SSH-2.0 banners and verbose SSH output.

Deepak Prasad10 min read
linux

How to Pass an SSH Password in a Script with sshpass and Expect

Automate password-based SSH and SCP in Linux using sshpass, Expect, and SSH_ASKPASS, with safer password input, host-key handling, and key-based alternatives.

Omer Cakmak15 min read
linux

Mount Remote Directory with SSHFS on Linux & Windows

Mount a remote Linux directory over SSH with SSHFS on RHEL, Ubuntu, and Windows. Covers install, user mounts, permissions, fstab, jump hosts, SSHFS-Win UNC paths, and troubleshooting.

Omer Cakmak16 min read
linux

Configure OpenSSH Host-Based Authentication on Linux

Configure OpenSSH host-based authentication on Linux with HostbasedAuthentication, ssh-keysign, shosts.equiv, and verified host keys—plus hostname/DNS checks and safer alternatives.

Omer Cakmak14 min read
linux

How to Test SSH Connection in Linux (Port, Service & Login)

Test SSH connectivity in Linux step by step: check port 22, verify that sshd responds, test authentication, inspect server-side sshd status, and troubleshoot common SSH errors.

Omer Cakmak14 min read
linux

SSH Through a Jump Host with ProxyJump, ProxyCommand & SCP

Connect to private Linux servers through an SSH jump or bastion host using ProxyJump, ssh -J, ProxyCommand, and scp -J, with multi-hop routes and troubleshooting examples.

Omer Cakmak13 min read
linux

SSH into a VirtualBox VM from Host: NAT, Host-Only, and Bridged

SSH from your host into a Linux VirtualBox VM using NAT port forwarding (recommended), host-only networking, or a bridged adapter — with a mode decision table, guest SSH checks, and troubleshooting for 10.0.2.15 and VPN …

Omer Cakmak12 min read
linux

OpenSSH Host Certificates: Trust Servers with a Host CA

Use OpenSSH host certificates so clients trust one host CA through @cert-authority in known_hosts instead of enrolling every server host key — create a host CA, sign with ssh-keygen -h, configure HostCertificate on sshd, …

Omer Cakmak16 min read
linux

Sign and Verify Files with SSH Keys Using ssh-keygen -Y

Sign files with ssh-keygen -Y sign, verify them with an allowed_signers file, signer identity, namespace, and stdin — no sshd or GPG required on OpenSSH 8.2 and later.

Omer Cakmak13 min read
linux

Fix SSH no matching key exchange method found

Fix SSH no matching key exchange method found by reading Their offer:, enabling the required KEX algorithm safely, and resolving follow-on host-key or cipher errors.

Omer Cakmak12 min read
linux

Fix SSH "Bad server host key: Invalid key length" Error

Fix SSH "Bad server host key: Invalid key length" caused by 1024-bit RSA host keys, RequiredRSASize, RHEL crypto policies, or stale known_hosts entries.

Deepak Prasad16 min read
linux

Fix userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedKeyTypes

Fix userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedKeyTypes by using rsa-sha2 with the same RSA key, or Ed25519, before any legacy ssh-rsa exception.

Deepak Prasad15 min read
linux

Revoke SSH Keys and Certificates with OpenSSH KRL

Create and update an OpenSSH Key Revocation List (KRL), revoke SSH certificates by serial, Key ID, or fingerprint, revoke plain public keys, and make sshd enforce RevokedKeys.

Deepak Prasad20 min read
linux

How to Configure OpenSSH Certificate Authentication with an SSH CA

Set up OpenSSH user certificate authentication with an SSH CA: create TrustedUserCAKeys, sign keys with principals and expiry, verify login, revoke with a KRL, then map principals with AuthorizedPrincipalsFile.

Deepak Prasad22 min read
linux

SSH Authentication Methods in sshd_config (Password, Public Key, PAM)

Configure OpenSSH authentication in sshd_config: password, public key, keyboard-interactive, host-based, GSSAPI, AuthenticationMethods, and Match blocks on Linux.

Deepak Prasad14 min read
linux

OpenSSH PerSourcePenalties: Block Repeated Failed SSH Connections

OpenSSH PerSourcePenalties on Linux: how sshd temporarily refuses noisy source addresses, how to read defaults with sshd -T, how to fix Not allowed at this time, and how exemptions and MaxAuthTries differ from Fail2ban.

Deepak Prasad22 min read
linux

Install and Trust a CA Certificate in the Linux System Trust Store

Install a private CA certificate into the Linux system trust store with update-ca-certificates on Debian and Ubuntu or update-ca-trust on RHEL and Fedora, verify the anchor landed, remove it again, and fix the …

Omer Cakmak20 min read
devops

Install Podman on Debian: APT, Versions & Rootless Setup

Install Podman on Debian 12 Bookworm and Debian 13 Trixie with apt, compare 4.3.x and 5.4.x package branches, verify with podman info, test rootless mode, and run a hello container.

Deepak Prasad6 min read
linux

How to Find and Fix Memory Leaks in Linux Applications

Read LeakSanitizer and Valgrind reports down to the line that owns the memory, use the flags that add detail, attribute growth with Massif, and query a running process with vgdb so you fix the cause instead of only …

Omer Cakmak42 min read
linux

How to Install libc.so.6 on Linux (glibc Package, Not a Download)

Diagnose libc.so.6 errors by message type — GLIBC_2.xx not found, cannot open shared object file, wrong ELF class, or damaged system libc — then fix with the matching glibc package, multilib, rebuild, container, or …

Omer Cakmak12 min read
linux

Configure Fail2ban to Protect SSH on Linux

Install Fail2ban, enable the sshd jail with sane bantime and ignoreip values, verify bans after failed SSH logins on RHEL and Debian, and unban trusted client addresses when needed.

Omer Cakmak10 min read
linux

Found a Swap File by the Name: Fix Vim .swp Warnings (E325)

Fix Vim E325 Found a swap file by the name by reading the .swp prompt, recovering after a crash, or removing a stale swap file once no editor owns it — not Linux swap memory from mkswap.

Omer Cakmak9 min read
linux

Fix SSH No Route to Host: Routing, Firewall, and sshd Checks

Diagnose SSH no route to host with TCP port tests, ip route get, remote firewalld and sshd checks, and learn when the message means a firewall REJECT instead of a missing route.

Omer Cakmak10 min read
linux

Idle SSH Sessions: Disconnect or Keep Them Alive on Linux

Set ClientAliveInterval and ClientAliveCountMax on sshd to drop unresponsive SSH clients, use ServerAliveInterval on the OpenSSH client to keep sessions alive through NAT, and understand how TCPKeepAlive differs.

Omer Cakmak8 min read
linux

Detect Rootkits on Linux with rkhunter

Install rkhunter from EPEL or apt, update its signature database, baseline file properties with propupd, run a non-interactive check, and interpret warnings in rkhunter.log on RHEL and Debian-family hosts.

Omer Cakmak7 min read
linux

Create a systemd Service Unit in Linux

Create a custom systemd .service unit under /etc/systemd/system/, explain Unit Service and Install sections, start and enable it with systemctl, and verify with status and journalctl.

Omer Cakmak6 min read
linux

How to Perform tar Incremental Backup on Linux

Take GNU tar listed-incremental backups with a snapshot file, create level 0 and level 1 archives, inspect Y and N file status, and restore by applying the full backup then each incremental in order.

Omer Cakmak8 min read
linux

SSH Multiplexing on Linux: Share One Connection

Reuse one authenticated SSH connection for later ssh, scp, and sftp sessions with ControlMaster, ControlPath, and ControlPersist on the OpenSSH client.

Omer Cakmak10 min read
linux

How to Copy a Directory Over SSH on Linux

Copy a directory and its contents between Linux hosts with scp -r and rsync -av over SSH, verify the remote layout, and avoid common path mistakes with trailing slashes.

Omer Cakmak7 min read
linux

Restrict SFTP Users to a Directory with OpenSSH Chroot

Restrict SFTP users to a chroot directory with OpenSSH ChrootDirectory, ForceCommand internal-sftp, Match blocks in sshd_config, writable upload folders, and SSH public-key authentication.

Omer Cakmak10 min read