Open main menu

CDOT Wiki β

Changes

OPS235 Lab 7 - CentOS7 - HD2

2 bytes added, 15:56, 24 October 2016
no edit summary
# <u>Restart</u> the service.
# Confirm the new port is being used with the '''netstat''' command.
# Before we can use this new port we must change our firewall to allow traffic through the new port number and block access to port 22 by issuing the command:<br /><b><code><span style="color:#3366CC;font-size:1.2em;">iptables -I INPUT -p tcp -s0/0 --dport 2200 -j ACCEPT</span></code></b>
# Next, we will drop any incoming traffic to port 22 by issuing the command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">iptables -I INPUT -p tcp -s0/0 --dport 22 -j DROP</span></code></b>
# We have now possibly mislead a potential "hacker" to the true port for our ssh server's communication channel (port).
# Switch to your '''centos1''' VM.
# Issue the commmand: <b><code><span style="color:#3366CC;font-size:1.2em;">ssh username@centos1</span></code></b>. What happens? What port do you think that command is using by default?
# Verify that the file '''/etc/sysconfig/iptables''' exists.
# Restart your iptables service and test your configuration.
 
 
# Before we can use this new port we must change our firewall to allow traffic through the new port number and block access to port 22 by issuing the command:<br /><b><code><span style="color:#3366CC;font-size:1.2em;">iptables -I INPUT -p tcp -s0/0 --dport 2200 -j ACCEPT</span></code></b>
# Next, we will drop any incoming traffic to port 22 by issuing the command:<br><b><code><span style="color:#3366CC;font-size:1.2em;">iptables -I INPUT -p tcp -s0/0 --dport 22 -j DROP</span></code></b>
# We have now possibly mislead a potential "hacker" to the true port for our ssh server's communication channel (port).
13,420
edits