Removed IPTables on Centos 7 and cannot access SFTP since

December 25, 2014 905 views

Hello! Recently I removed IPTables on my Centos 7 Droplet and since then I cannot access my server via SFTP only via the Droplet console.. I understand that It has to be some sort of Centos 7 specific Firewall problem? Any suggestions to fix this problem Is much Appreciated.. Thanks!

1 Answer

CentOS 7 uses firewalld to implement firewalling. To check if it is enabled, run:

sudo systemctl status firewalld

If you use the default port 22 for SSH connections, you can open that port by running:

sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload

For more info, check out the "Configuring a Basic Firewall" section of our Additional Recommended Steps for New CentOS 7 Servers tutorial.

After setting up the bare recommended configuration for a new server, there are often some additional steps that are highly recommended in most cases. In this guide, we'll continue the initial configuration by tackling some recommended, but optional procedures.
Have another answer? Share your knowledge.