Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 26738  / 1 Year ago, mon, february 20, 2023, 11:31:29

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.


More From » server

 Answers
7

PID/Program name is blank because you are not running as root, try,



sudo netstat -tupln


You can ssh localhost to check if the sshd is working. Check the firewall afterward.



EDIT:



After looking into the syslog I realised that the server was blocking inputs from eth1. So what I did was use



sudo ufw allow 22


and accept inputs from this port.



I don't know why it worked before and stopped. And this is the first time I enabled this port to get ssh working. But this did the trick.



Many thanks to neo and gertvdijk for the inputs.


[#33043] Tuesday, February 21, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
trousransla

Total Points: 285
Total Questions: 112
Total Answers: 113

Location: Spain
Member since Thu, Dec 23, 2021
2 Years ago
;