Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Ban a remote IP Address using iptables

Answer:

iptables -A INPUT -s IP -j DROP

Replace IP with the actual remote IP address.

Note that the blocking will be lost when server reboot. You would need to save the rule(s) into a script and reload when server reboot.

  1. Allow a remote IP for incoming connection in UFW (Uncomplicated firewall)
  2. Edit a remote file with vim over SSH
  3. How to transfer your identity.pub to the remote machine’s authorized_keys?
  4. Convert IP address to HEX in Bash script
  5. Running a command on the remote server

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>