Open main menu

CDOT Wiki β

Changes

OPS235 Lab 7

No change in size, 06:57, 28 June 2016
no edit summary
# OpenSSH should have been installed by default. Let's confirm this by issuing the command:<br /> <b><code><span style="color:#3366CC;font-size:1.2em;">rpm -qa | grep ssh</span></code></b>
# You should see a number of packages installed including <b>openssh-clients</b> and <b>openssh-server</b>
# <b><code><span style="color:#3366CC;font-size:1.2em;">openssh-server</span></code></b> installs a service called '''sshd'''. Confirm that this service is running by issuing the command:<br /><b><code><span style="color:#3366CC;font-size:1.2em;">systemctl status sshd</span></code></b><br><br>'''NOTE:''' We can use the '''netstat''' utility as a trouble-shooting / confirmation tool to view the SSH service and determine which STATE the SSH service is performing:::*'''LISTENING''' (waiting for a ssh connection attempt)::*'''ESTABLISHED''' (connection established)::*'''CLOSED''' (connection is closed)::*'''WAITING''' (time between connection closed, and changing to LISTENING mode)<br><br>
<ol><li value="6">Now that you know the service is running, investigate what '''port number''' and '''protocol''' sshd uses by issuing the command:<br /><b><code><span style="color:#3366CC;font-size:1.2em;">netstat -atunp | grep sshd</span></code></b></li>
<li>What protocol and port is the sshd process using? What is the state of the port? Why would you think that UDP ports don't have a state?</li>
'''Perform the following steps:'''
# Switch to your '''centos3''' VM.<br><br>'''NOTE:''' We can use the '''netstat''' utility as a trouble-shooting / confirmation tool to view the SSH service and determine which STATE the SSH service is performing:::*'''LISTENING''' (waiting for a ssh connection attempt)::*'''ESTABLISHED''' (connection established)::*'''CLOSED''' (connection is closed)::*'''WAITING''' (time between connection closed, and changing to LISTENING mode)<br><br>
# Run the '''netstat -atunp''' command (pipe to "grep sshd") to check the state of a possible ''ssh connection''. What is the state (i.e. LISTENING or ESTABLISHED)?
# Open another terminal and establish an ssh connection to your '''centos3''' VM using the command:<br /><b><code><span style="color:#3366CC;font-size:1.2em;">ssh ops235@centos3</span></code></b><br>(Where 'ops235' is the account on centos3 and 'centos3' is the hostname of the centos3 VM.)<br><br>
13,420
edits