From charlesreid1

Procedure

Following procedure detailed at Widy/Access Point:

Create a wireless network with the Widy, called OpenWrts.

From machine A, cronus, connect to OpenWrts network. Obtain IP address 10.0.0.140

From machine B, morpheus, connect to OpenWrts network. Obtain IP address 10.0.0.228

Ping

From machine A, ping machine B:

[machineA]$ ping 10.0.0.228

success.

From machine B, ping machine A:

[machineB]$ ping 10.0.0.140

success.

We can even log into the Widy and monitor traffic on the wireless interface:

$ ssh root@10.0.0.1

$ tcpdump -i wlan0

You should see lots of ICMP echo request/reply packets if you do that while running ping.

SSH

Now comes the important part. See if we can SSH.

Try to SSH from machine A into machine B:

$ ssh root@10.0.0.228
ssh: connect to host 10.0.0.228 port 22: Connection refused

Oh boy. Now try to SSH from machine B into machine A:

$ ssh charles@10.0.0.140
Password: 

Success!

Honing In on the Problem

The problem appears to be with Machine B's ssh. Try restarting it:

[machineB]$ service ssh restart; service sshd restart

Now, when we SSH into machine B from machine A, instead of getting connection refused, we get connection closed:

[machineA]$ ssh root@10.0.0.228
Connection closed by 10.0.0.228

Digging deeper, with more verbosity:

[machineA]$ ssh -v root@10.0.0.228
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: /etc/ssh/ssh_config line 102: Applying options for *
debug1: Connecting to 10.0.0.228 [10.0.0.228] port 22.
debug1: Connection established.
debug1: identity file /Volumes/noospace/Users/charles/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Volumes/noospace/Users/charles/.ssh/id_rsa-cert type -1
debug1: identity file /Volumes/noospace/Users/charles/.ssh/id_dsa type 2
debug1: key_load_public: No such file or directory
debug1: identity file /Volumes/noospace/Users/charles/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Volumes/noospace/Users/charles/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Volumes/noospace/Users/charles/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Volumes/noospace/Users/charles/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Volumes/noospace/Users/charles/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.7p1 Debian-5+deb8u1
debug1: match: OpenSSH_6.7p1 Debian-5+deb8u1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 10.0.0.228:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 10.0.0.228

Checking /var/log/syslog on Machine B showed a message: sshd: Could not load host key: /etc/ssh/ssh_host_xxxxx_key

This message is created when the service sshd restart command is run.

Trying to ssh to localhost from machine B:

$ ssh localhost
Read from socket failed: connection reset by peer

Fix

Fixed the problem with

$ dpkg-reconfigure openssh-server
$ service sshd restart

Now I'm able to run

[machineB]$ ssh localhost

no problemo.

can also ssh from machine A into machine B:

[machineA]$ ssh 10.0.0.228

no problemo.