Contents
How to restrict access to SSH by IP?
I would like to allow a certain IP addresses or a whole network (source) to reach my servers with ssh connection and to drop all other unauthorized source IP addresses. There are other ways to do it, but this is simplest when we know nothing about your other rules. Sometimes command line IpTables syntax can be a bit much to learn/digest.
How to block SSH and FTP access to specific IP and network range?
For example, let us block the SSH and FTP access to host that has IP address 192.168.1.100 and network range 192.168.1.0. This method is same for CentOS 6.x and 7.x series.
How to lock down access to specific IP addresses?
I would then recommend using Webmin & IpTables to lock down webin access to only those specific IP addresses you wish. You use the same syntax as some of the other posters have answered, just changing the PORT to whatever you setup Webmin to use. (Hopefully something OTHER than the standard port:10000).
Do you need a drop rule for iptables?
Iptables rules are evaluated in order, until first match. For example, to allow traffic from 192.168.0.0/24 network and otherwise drop the traffic (to port 22). The DROP rule is not required if your iptables default policy is configured to DROP.
What is the iptables rule to allow incoming SSH connections?
IPTables rule to allow incoming SSH connections. The aim of this script is to only allow traffic over the VPN, except for localhost<->localhost and incoming SSH traffic. But when I run the script over SSH I am disconnected and forced to restart the vm. What is wrong with my script?
How to set iptables-P output accept in FTP server?
Note: you must set the 1024: as in your FTP server: search for the default passive ports in your FTP configuration. Else you’d open too many ports that may not be FTP relative. Important note: I didn’t add OUTPUT rules as my defaults go with iptables -P OUTPUT ACCEPT.
How to allow only one IP through iptables?
How can I on my ubuntu server, in Iptables only allow one IP adress on a specific port? I use shorewall to configure IP table. Use a rule like to accept from one host to port 123.