?
Solved

port 22 refussed on two out of three computers

Posted on 2009-04-30
6
Medium Priority
?
778 Views
Last Modified: 2013-12-23
I have 3 computers:

findsmb:
                                *=DMB
                                +=LMB
IP ADDR         NETBIOS NAME     WORKGROUP/OS/VERSION
---------------------------------------------------------------------
172.16.1.35     UBUNTU        +[WORKGROUP] [Unix] [Samba 3.2.3]
172.16.1.36     B202           [WORKGROUP] [Unix] [Samba 3.2.3]
172.16.1.37     KEN-LAPTOP     [WORKGROUP] [Unix] [Samba 3.0.28a]

Ubuntu 8.1 loaded on ...35 & ...37, eeebuntu 8.1 loaded on ...36.

I need to copy files between all three computers.

i tried scp ($ scp -r /home/ken/pictures/* ken@xxx.xx.x.xx:/home/ken/pictures

35 > 36 : ssh: connect to host 172.16.1.36 port 22: Connection refused
35 > 37 : connection established - files transfered
36 > 35 : ssh: connect to host 172.16.1.35 port 22: Connection refused
36 > 37 : connection established - files transfered
37 > 35 : ssh: connect to host 172.16.1.35 port 22: Connection refused
37 > 36 : ssh: connect to host 172.16.1.36 port 22: Connection refused

I got similar results when I tried plain old ssh between computers.

I can ping in all six directions (35>36, 35>37, 36>35, 36>37, 37>35, 37>36)

It seems obvious to me that something is different in KEN-LAPTOP.  I looked at the /etc/samba/smb.conf files and they are identical.

Where else should I look to find what's different?
0
Comment
Question by:KenSpeedie
  • 3
  • 2
6 Comments
 
LVL 2

Assisted Solution

by:jbristle
jbristle earned 500 total points
ID: 24274068
have you verified that sshd is running on all of your hosts?
you can also try
ssh -vvv ip

0
 
LVL 10

Assisted Solution

by:lanboyo
lanboyo earned 1500 total points
ID: 24274421
Jbristle is correct.

On each machine do a "sudo netstat -tupan"

If they do not have a line that says something like...
 0 0.0.0.0:22          0.0.0.0:*               LISTEN     12345/sshd

Then they are not running the secure shell server. SMB and Secure Shell are different.
0
 

Author Comment

by:KenSpeedie
ID: 24287007
I made sure sshd was running on all hosts.  Had to add sshd to ...35.  Now I can scp or ssh in all directions EXCEPT I can scp and ssh FROM ...35 but not TO ...35.

I ran "sudo netstat -tupan" on all three hosts.

netstat -tupan for all three hosts follows:

Note that  ...35 is not listening on port 22.  I verified (?) that sshd was installed on ..35 (I looked at the synaptic and it says sshd is installed.)  - how do I verify that sshd is indeed runniing on this host not just installed but not started?  If it is not running, how do I start it and make sure it starts on startup?

172.16.1.35 sudo netstat -tupan:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp         0      0 0.0.0.0:631         0.0.0.0:*        LISTEN      4814/cupsd      
tcp6       0      0 :::139                  :::*                 LISTEN      4877/smbd      
tcp6       0      0 ::1:5900              :::*                 LISTEN      5712/vino-server
tcp6       0      0 :::631                  :::*                 LISTEN      4814/cupsd      
tcp6       0      0 :::445                  :::*                 LISTEN      4877/smbd      
tcp6       0      0 172.16.1.35:445         172.16.0.1:63237        TIME_WAIT   -              
tcp6       0      0 172.16.1.35:445         172.16.0.1:63239        ESTABLISHED 5895/smbd      
udp        0      0 172.16.1.35:137         0.0.0.0:*                           4875/nmbd      
udp        0      0 0.0.0.0:137                 0.0.0.0:*                           4875/nmbd      
udp        0      0 172.16.1.35:138         0.0.0.0:*                           4875/nmbd      
udp        0      0 0.0.0.0:138                 0.0.0.0:*                           4875/nmbd      
udp        0      0 0.0.0.0:68                   0.0.0.0:*                           5451/dhclient  
udp        0      0 0.0.0.0:5353               0.0.0.0:*                           4744/avahi-daemon:
udp        0      0 0.0.0.0:43634             0.0.0.0:*                           4744/avahi-daemon:
udp        0      0 0.0.0.0:631                 0.0.0.0:*                           4814/cupsd      

172.16.1.36 sudo netstat -tupan:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:3400            0.0.0.0:*               LISTEN      5547/python    
tcp        0      0 127.0.0.1:7634        0.0.0.0:*               LISTEN      4755/hddtemp    
tcp        0      0 0.0.0.0:22                0.0.0.0:*                                                      LISTEN      4647/sshd      
tcp        0      0 0.0.0.0:631              0.0.0.0:*               LISTEN      4688/cupsd      
tcp        0      0 172.16.1.36:3400        172.16.1.36:53382       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53384       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53390       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53391       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53380       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53385       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53388       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53387       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53389       TIME_WAIT   -              
tcp       32      0 127.0.1.1:60575         127.0.1.1:139           ESTABLISHED 6490/gvfsd-smb-brow
tcp        0      0 172.16.1.36:3400        172.16.1.36:53386       TIME_WAIT   -              
tcp        0      0 172.16.1.36:3400        172.16.1.36:53381       TIME_WAIT   -              
tcp        8      0 172.16.1.36:37542      172.16.1.35:445         ESTABLISHED 6503/gvfsd-smb  
tcp       32      0 172.16.1.36:52970     172.16.1.35:139         ESTABLISHED 6490/gvfsd-smb-brow
tcp        0      0 172.16.1.36:3400        172.16.1.36:53383       TIME_WAIT   -              
tcp6       0      0 :::139                 :::*                    LISTEN      4810/smbd      
tcp6       0      0 :::22                   :::*                    LISTEN      4647/sshd      
tcp6       0      0 :::631                 :::*                    LISTEN      4688/cupsd      
tcp6       0      0 :::445                 :::*                    LISTEN      4810/smbd      
tcp6       0      0 172.16.1.36:445         172.16.0.1:63382        ESTABLISHED 6675/smbd      
tcp6       0      0 172.16.1.36:445         172.16.0.1:63380        TIME_WAIT   -              
tcp6       0      0 127.0.1.1:139             127.0.1.1:60575         ESTABLISHED 6494/smbd      
udp        0      0 172.16.1.36:137         0.0.0.0:*                           4808/nmbd      
udp        0      0 0.0.0.0:137                 0.0.0.0:*                           4808/nmbd      
udp        0      0 172.16.1.36:138         0.0.0.0:*                           4808/nmbd      
udp        0      0 0.0.0.0:138                 0.0.0.0:*                           4808/nmbd      
udp        0      0 0.0.0.0:42145             0.0.0.0:*                           4616/avahi-daemon:
udp        0      0 0.0.0.0:68                   0.0.0.0:*                           5677/dhclient  
udp        0      0 0.0.0.0:5353               0.0.0.0:*                           4616/avahi-daemon:
udp        0      0 0.0.0.0:631                 0.0.0.0:*                           4688/cupsd      


172.16.1.37 sudo netstat -tupan:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      5328/smbd      
tcp        0      0 0.0.0.0:631             0.0.0.0:*               LISTEN      5210/cupsd      
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      5328/smbd      
tcp        0      0 172.16.1.37:57988     172.16.1.37:22            ESTABLISHED 16505/ssh      
tcp        0      0 172.16.1.37:445         172.16.0.1:63170        ESTABLISHED 5778/smbd      
tcp6      0      0 :::5900               :::*                                         LISTEN      5965/vino-server
tcp6      0      0 :::22                   :::*     LISTEN      5153/sshd      
tcp6      0      0 :::631                 :::*                                         LISTEN      5210/cupsd      
tcp6      0    960 172.16.1.37:22         172.16.1.36:38441      ESTABLISHED 6866/sshd: ken [pri
tcp6      0      0 172.16.1.37:22           172.16.1.37:57988      ESTABLISHED 16506/sshd: ken [pr
udp       0      0 172.16.1.37:137          0.0.0.0:*                           5326/nmbd      
udp       0      0 0.0.0.0:137                  0.0.0.0:*                           5326/nmbd      
udp       0      0 172.16.1.37:138          0.0.0.0:*                           5326/nmbd      
udp       0      0 0.0.0.0:138                  0.0.0.0:*                           5326/nmbd      
udp       0      0 0.0.0.0:52529              0.0.0.0:*                           5174/avahi-daemon:
udp       0      0 0.0.0.0:68                    0.0.0.0:*                           4445/dhclient3  
udp       0      0 0.0.0.0:5353                0.0.0.0:*                           5174/avahi-daemon:
udp       0      0 0.0.0.0:631                  0.0.0.0:*                           5210/cupsd      
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
LVL 10

Assisted Solution

by:lanboyo
lanboyo earned 1500 total points
ID: 24287132
Try this an look for errors...

apt-get install ssh openssh-server

It should configure and install by itself. It will put a startup entry so that it starts automatically from now on.
0
 
LVL 10

Assisted Solution

by:lanboyo
lanboyo earned 1500 total points
ID: 24294882
sudo apt-get of course.
0
 

Accepted Solution

by:
KenSpeedie earned 0 total points
ID: 24452892
Note for moderator:

This is the third time I closed a question, awarded the points only to have you come back and tell me I have an open question.

I solved the problem.  Turns out I had to tweak the /etc/ssh/sshd_config file to match the ones in the hosts that were working.  (I made them all alike.)

Thanks for responding and your help.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question