

When CSF Firewall and IPTables are properly running you’ll see something similar to the following IPTable rules listed: ipatbles -L -v -nĬhain INPUT (policy DROP 0 packets, 0 bytes) You can view all the configured IPTable rules via either of these two commands: When you run iptables -F command, you end up flushing and removing all IPTable rules configured by CSF Firewall. Tmpfs tmpfs 496M 0 496M 0% /sys/fs/cgroupĬentmin Mod local code is up to date at /usr/local/src/centminmod Total used free shared buff/cache availableįilesystem Type Size Used Avail Use% Mounted on System uptime.: 274 days 14 hours 17 minutes 33 seconds Users.: Currently 2 user(s) logged on (includes: root) The full MOTD banner on initial SSH login displayed to the user looks like this: = # DO NOT run the below command or you will lock yourself out of the server:

# ! This server maybe running CSF Firewall ! How To Regain Lost SSH Access After IPTables Flushing?Ĭentmin Mod’s MOTD banner displayed on initial SSH login even mentions and warns against running iptables -F as you can see below excerpt: =.So if you like this guide, please consider signing up via the links. This guide will outline ways you can possibly regain SSH access using example VPS providers – Upcloud, DigitalOcean, Vultr, Linode, Hetzner and Amazon AWS EC2 instance servers.Īffiliate referral links are used where appropriate. If you run the SSH command, iptables -F you may end up locking yourself out of the server as this command flushes all the existing IPTable rules that are configured and setup by CSF Firewall at startup. So how do you regain SSH access? Centmin Mod LEMP stack uses CSF Firewall which is a wrapper interface to CentOS system’s underlying IPTables. You’ve accidentally run the SSH command iptables -F and have locked yourself out of your server and can not SSH login again.
