Liangxu Linux
Liangxu Linux
Jan 2, 2025 · Information Security

How to Block SSH Logins for Specific Users, Groups, and IP Ranges on Linux

This guide explains multiple Linux techniques—setting a user’s shell to /sbin/nologin, editing /etc/passwd, configuring sshd_config with Allow/Deny directives, and using hosts.allow/hosts.deny—to prevent unwanted SSH access for particular users, groups, or IP addresses, and shows how to apply the changes safely.

LinuxSSHhosts.allow
0 likes · 11 min read
How to Block SSH Logins for Specific Users, Groups, and IP Ranges on Linux
Liangxu Linux
Liangxu Linux
Jun 29, 2024 · Information Security

How to Block SSH Logins for Specific Users, Groups, and IPs on Linux

This guide explains multiple Linux techniques—including nologin shells, sshd_config allow/deny lists, and hosts.allow/hosts.deny rules—to prevent selected users, groups, or IP addresses from logging in via SSH, with practical commands, examples, and a ready‑to‑run script.

LinuxSSHSecurity
0 likes · 11 min read
How to Block SSH Logins for Specific Users, Groups, and IPs on Linux
MaGe Linux Operations
MaGe Linux Operations
Dec 12, 2021 · Information Security

How to Stop Brute‑Force SSH Attacks on Your Raspberry Pi

This article explains how a Raspberry Pi exposed to the Internet was repeatedly attacked via SSH, how the author identified the brute‑force attempts in /var/log/auth.log, and step‑by‑step methods using hosts.allow/deny and ufw to whitelist trusted IPs and block malicious traffic.

Brute-force protectionLinux SecuritySSH Security
0 likes · 5 min read
How to Stop Brute‑Force SSH Attacks on Your Raspberry Pi