LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ssh works only intermittantly on home network (https://www.linuxquestions.org/questions/linux-networking-3/ssh-works-only-intermittantly-on-home-network-4175438464/)

crs17 11-23-2012 02:37 PM

ssh works only intermittantly on home network
 
I have a small home network: two linux boxes connected together by a wireless hub. And a WIMAX modem ethernetted cabled from the hub.

When I try to ssh from one linux box to the other, sometimes it works and sometimes I get "ssh: connect to host cuda-host port 22: Connection refused". ("cuda-host" IS the system name I am trying to connect to). I can't decide what causes it to work or not work, but the change only happens when one or both boxes are powered down.

I'm issuing the commands "ssh cuda-host" or "ssh -X cuda-host". I have gotten both versions to work at times (and the remote X window worked also).

Any ideas how I debug ssh?

Thanks,

Craig

devil24g 11-23-2012 03:15 PM

check logs?

273 11-23-2012 03:22 PM

How are you resolving host names, do you use static IP addresses and /etc/hosts or are you relying on something else?

crs17 11-23-2012 08:06 PM

I'm using /etc/hosts. Here is the /etc/hosts (and I'm not using ip6):
------
127.0.0.1 localhost
127.0.1.1 crs
192.168.0.101 crs
192.168.0.100 cuda-host

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
------
The /etc/hosts are the same on both systems (except that 127.0.1.1 has the local name
on each system - ie, crs or cuda-host). As to the log files, I don't know where they are.

crs17 11-24-2012 07:48 PM

I found my logs - under ubuntu 12.04 it is /var/logs/auth.log . On the client, the failed ssh's are noted by:

Code:

Nov 24 20:27:28 crs lightdm: pam_unix(lightdm:session): session opened for user lightdm by (uid=0)
Nov 24 20:27:28 crs lightdm: pam_ck_connector(lightdm:session): nox11 mode, ignoring PAM_TTY :0
Nov 24 20:27:29 crs lightdm: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "craig"
Nov 24 20:27:35 crs lightdm: pam_unix(lightdm:session): session closed for user lightdm

The second and third line of the above seem incorrect and shouldn't be there.

On the server (cuda-host), I don't have any messages in auth.log at 20:27 +- 3 minutes. So, not surprisingly, the ssh never got through.

At a random time before this ssh attempt there is a line on the client:
Code:

Nov 24 19:50:26 crs polkitd(authority=local): Registered Authentication Agent for unix-session:/org/freedesktop/ConsoleKit/Session2 (system bus name :1.49 [/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1], object path /org/gnome/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Could this be the cause of the problem? If so, what actually went wrong? Again, on the server there is no corresponding entry. And since I do concurrent "date" commands on the two machines and get approximately the same time, I assume the machine's clock's ARE sync'ed.

Thanks,

Craig


All times are GMT -5. The time now is 11:17 PM.