<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    sudo netstat -anp | grep tcp | grep LISTEN<br>
    <br>
    -a == all<br>
    -n == do not resolve dns (slows it down significantly)<br>
    -p == show the app opening the socket (requires sudo to enumerate)<br>
    <br>
    grep tcp == look for tcp-based sockets (most apps won't use udp)<br>
    grep LISTEN == look at listening sockets, vs established that
    indicated something *is* connected<br>
    <br>
    This is a good one to remember, this shows all your "listening"
    sockets.  Your ssh socket is outbound to another host, but doesn't
    look like sshd is listening on port 22, which won't let you in.<br>
    <br>
    TCP/UDP sockets are your door into the system.<br>
    <br>
    mb@host ~ $ sudo netstat -anp | grep tcp | grep ssh<br>
    [sudo] password for mb: <br>
    tcp        0      0 0.0.0.0:22              0.0.0.0:*              
    LISTEN      19847/sshd      <br>
    tcp6       0      0 :::22                   :::*                   
    LISTEN      19847/sshd   <br>
    <br>
    First is ipv4-based socket, second is ipv6-based.  You should see
    similar, with 0.0.0.0 meaning it's listening on _all_ interfaces.<br>
    <br>
    -mb<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 07/17/2014 12:28 PM, Michael Havens
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAFRvunLAdgiijGRREMyiOtZNwD222CPhyL-M5OTG2mJNmsE5UA@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>okay,<br>
                    </div>
                    netsstat on the server prints out a lot of data.<br>
                  </div>
                  The first section says:<br>
                  Active Internet connections (w/o servers)<br>
                  Proto Recv-Q Send-Q Local Address           Foreign
                  Address         State      <br>
                  tcp        0      0 <a moz-do-not-send="true"
                    href="http://192.168.0.4:38521">192.168.0.4:38521</a>      
                  lax17s01-in-f21.1:https ESTABLISHED<br>
                  tcp        0      0 <a moz-do-not-send="true"
                    href="http://192.168.0.4:36523">192.168.0.4:36523</a>      
                  lax17s01-in-f4.1e:https ESTABLISHED<br>
                  tcp        0      0 localhost:45886        
                  localhost:53919         ESTABLISHED<br>
                  tcp        0      0 localhost:ssh          
                  localhost:56545         ESTABLISHED<br>
                  tcp        0      0 localhost:44799        
                  localhost:53919         ESTABLISHED<br>
                  tcp        0      0 localhost:47157        
                  localhost:53919         ESTABLISHED<br>
                  tcp        0      0 localhost:53919        
                  localhost:44799         ESTABLISHED<br>
                  tcp        0      0 localhost:53919        
                  localhost:47157         ESTABLISHED<br>
                  tcp        0      0 localhost:56545        
                  localhost:ssh           ESTABLISHED<br>
                  tcp        0      0 localhost:53919        
                  localhost:45886         ESTABLISHED<br>
                  tcp        0      0 <a moz-do-not-send="true"
                    href="http://192.168.0.4:37884">192.168.0.4:37884</a>      
                  lax17s01-in-f0.1e:https ESTABLISHED<br>
                  tcp        0      0 <a moz-do-not-send="true"
                    href="http://192.168.0.4:45304">192.168.0.4:45304</a>      
                  lax17s01-in-f5.1e:https ESTABLISHED<br>
                  tcp        0      0 <a moz-do-not-send="true"
                    href="http://192.168.0.4:36525">192.168.0.4:36525</a>      
                  lax17s01-in-f4.1e:https ESTABLISHED<br>
                  tcp6       1      0 ip6-localhost:53614    
                  ip6-localhost:ipp       CLOSE_WAIT <br>
                  <br>
                </div>
                while the second section says:<br>
                Active UNIX domain sockets (w/o servers)<br>
                Proto RefCnt Flags       Type       State        
                I-Node   Path<br>
                unix  18     [ ]         DGRAM                   
                11578    /dev/log<br>
                unix  2      [ ]         DGRAM                   
                10914    /var/run/wpa_supplicant/wlan0<br>
                unix  3      [ ]         STREAM     CONNECTED    
                343530   <br>
                unix  3      [ ]         STREAM     CONNECTED    
                198728   <br>
                unix  3      [ ]         STREAM     CONNECTED    
                198167   <br>
                unix  3      [ ]         STREAM     CONNECTED    
                198683   <br>
              </div>
              ---edit out a lot of stuff--<br>
              <br>
            </div>
            while on the remote system netstat prints 7 lines that is
            basically the second section (above).<br>
            <br>
          </div>
          I'm not sure how to run sshin debug mode but the man page
          implies to run it with the verbose flag:<br>
          :~$ ssh -v <a moz-do-not-send="true"
            href="mailto:mike@192.168.1.101">mike@192.168.1.101</a><br>
          OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014<br>
          debug1: Reading configuration data /etc/ssh/ssh_config<br>
          debug1: /etc/ssh/ssh_config line 19: Applying options for *<br>
          debug1: Connecting to 192.168.1.101 [192.168.1.101] port 22.<br>
          debug1: connect to address 192.168.1.101 port 22: Connection
          timed out<br>
          ssh: connect to host 192.168.1.101 port 22: Connection timed
          out<br>
          bmike1@CQ57-1:~$ ssh -vv <a moz-do-not-send="true"
            href="mailto:mike@192.168.1.101">mike@192.168.1.101</a><br>
          OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014<br>
          debug1: Reading configuration data /etc/ssh/ssh_config<br>
          debug1: /etc/ssh/ssh_config line 19: Applying options for *<br>
          debug2: ssh_connect: needpriv 0<br>
          debug1: Connecting to 192.168.1.101 [192.168.1.101] port 22.<br>
          debug1: connect to address 192.168.1.101 port 22: Connection
          timed out<br>
          ssh: connect to host 192.168.1.101 port 22: Connection timed
          out<br>
          <br>
          <br>
          :~$ ps -aef | grep sshd<br>
          root      1308     1  0 Jul15 ?        00:00:00 /usr/sbin/sshd
          -D<br>
          bmike1   19566  4242  0 11:53 pts/2    00:00:00 grep
          --colour=auto sshd<br>
          <br>
          <br>
        </div>
        it doesn't seem ssh failed at any point.<br>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>:-)~MIKE~(-:</div>
        <br>
        <br>
        <div class="gmail_quote">On Thu, Jul 17, 2014 at 12:33 AM, James
          Mcphee <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:jmcphe@gmail.com" target="_blank">jmcphe@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Verify openssh is enabled on the server with
              netstat.  Verify you can connect to port 22 from client to
              server.  Run ssh in debug mode to see messages.  When you
              hit a point that it fails, then you have a better idea of
              what's wrong.</div>
            <div class="gmail_extra"><br>
              <br>
              <div class="gmail_quote">
                <div>
                  <div class="h5">On Wed, Jul 16, 2014 at 9:54 PM,
                    Michael Havens <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:bmike1@gmail.com" target="_blank">bmike1@gmail.com</a>></span>
                    wrote:<br>
                  </div>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div class="h5">
                      <div dir="ltr">
                        <div>okay, so I bought a used computer to do
                          Linux from scratch on. Well, I'm going to ssh
                          from my primary computer to the new computer
                          but got a 'Connection timed out' error. After
                          googling for a bit I discovered ufw was to
                          blame.<br>
                          <br>
                          after I disabled the firewall I could ssh from
                          192.168.1.101 <parasite> to 192.168.0.4
                          <host><br>
                          <br>
                          the error I got going the other way was the
                          connection timed out error:<br>
                          <br>
                          ssh <a moz-do-not-send="true"
                            href="mailto:mike@192.168.1.101"
                            target="_blank">mike@192.168.1.101</a><br>
                          ssh: connect to host 192.168.1.101 port 22:
                          Connection timed out<br>
                          <br>
                        </div>
                        <div>After googling some more I thought perhaps
                          openssh-server wasn't installed... but it is.
                          So please.... what is the problem? I verifed
                          openssh-client is installed but I don't know
                          what it could be. Could you help me out?<br>
                        </div>
                        <div>:-)~MIKE~(-:</div>
                      </div>
                      <br>
                    </div>
                  </div>
                  ---------------------------------------------------<br>
                  PLUG-discuss mailing list - <a moz-do-not-send="true"
                    href="mailto:PLUG-discuss@lists.phxlinux.org"
                    target="_blank">PLUG-discuss@lists.phxlinux.org</a><br>
                  To subscribe, unsubscribe, or to change your mail
                  settings:<br>
                  <a moz-do-not-send="true"
                    href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss"
                    target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><span
                    class="HOEnZb"><font color="#888888"><br>
                    </font></span></blockquote>
              </div>
              <span class="HOEnZb"><font color="#888888"><br>
                  <br clear="all">
                  <div><br>
                  </div>
                  -- <br>
                  James McPhee<br>
                  <a moz-do-not-send="true"
                    href="mailto:jmcphe@gmail.com" target="_blank">jmcphe@gmail.com</a>
                </font></span></div>
            <br>
            ---------------------------------------------------<br>
            PLUG-discuss mailing list - <a moz-do-not-send="true"
              href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
            To subscribe, unsubscribe, or to change your mail settings:<br>
            <a moz-do-not-send="true"
              href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss"
              target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">---------------------------------------------------
PLUG-discuss mailing list - <a class="moz-txt-link-abbreviated" href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a>
To subscribe, unsubscribe, or to change your mail settings:
<a class="moz-txt-link-freetext" href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a></pre>
    </blockquote>
    <br>
  </body>
</html>