Block port (SSH) on centos7 with IPTables
Channel:
Subscribers:
4,970
Published on ● Video Link: https://www.youtube.com/watch?v=ba644iszIDc
how to block a port on centos 7 with IPTABLES.
-----------------
in this video i will block SSH port (22) with IPTABLES.
steps :
1) install iptables with :
sudo yum install iptables-services
2) block port :
sudo iptables -I INPUT -p tcp --dport 22 -j REJECT
3) save iptables :
sudo service iptables save
4) try to connect to centos7 with ssh.
sudo ssh root@192.168.56.105
and you will see a message :
ssh: connect to host 192.168.56.105 port 22: Connection Refused.
yeah, port 22 is blocked! bingo!
--------------
** to unblock port, type :
sudo iptables -D INPUT 1
sudo service iptables save
Other Videos By Ambar Hasbiyatmoko
Tags:
port
block
iptables
centos7
ssh
ubuntu
linux
terminal
script
ip
connect
unblock
install