This is all within a LAN. My server can be pinged. I can run php apps on my server from within the LAN.
I have installed openssh-server. I tried the command:
ps aux
and it shows the:
process listed as /usr/sbin/sshd -D
However, when I try the command:
netstat -tulpn
the PID/Program name column is blank (I mean it has a hyphen).
Honestly, I don't understand this area too well.
But the strange thing is that SSH used to work but it suddenly stopped. I'd really love to have some help on resolving this.
EDIT:
I Just realised that I cannot even run php apps via a browser. But localhost in the URI works with the default index.html page.
MORE INFO:
Just for the record, I never changed any iptables
settings. Only after I got stuck with this problem that I did iptables -F
.
I've even tried reinstalling ssh a couple of times but I do get the feeling that the entries in iptables are causing this problem as I learnt from the comments of below.
If I turn off the firewall with ufw disable
, ssh localhost
works.
Now when I try accessing this server from another PC, I get a pretty big error message like this:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS
POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be
eavesdropping on you right now (man-in-the-middle attack)! It is also
possible that a host key has just been changed. The fingerprint for
the ECDSA key sent by the remote host is
d4:........4:e9:75:06:61. Please contact your
system administrator. Add correct host key in
/home/khalid/.ssh/known_hosts to get rid of this message. Offending
ECDSA key in /home/khalid/.ssh/known_hosts:1 remove with: ssh-keygen
-f "/home/khalid/.ssh/known_hosts" -R 192.168.1.6 ECDSA host key for 192.168.X.X has changed and you have requested strict checking. Host key verification failed.
and there's no connection.