New installation of RHEL8 with openssh-server installed, enabled, and running.
firewall-cmd shows service ssh is added:
[[email protected] ]# firewall-cmd --list-services cockpit ssh
netstat -anp | grep 22 shows the server is listening over 0:0:0:0:22
service sshd status shows the same (listening on port 22)
nmap -sSV -O -p 22 localhost (issued from new.rhel.server) shows that port 22 is open.
I am able to
ssh localhost on new.rhel.server successfully. The server has internet connectivity.
When I try to
ssh [email protected], I get an immediate Connection Refused error.
me@laptop ~ $ ssh -vvv new.rhel.server OpenSSH_8.2p1 Ubuntu-4ubuntu0.5, OpenSSL 1.1.1f 31 Mar 2020 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug2: resolving "new.rhel.server" port 22 debug2: ssh_connect_direct debug1: Connecting to new.rhel.server [188.8.131.52] port 22. debug1: connect to address 184.108.40.206 port 22: Connection refused ssh: connect to host new.rhel.server port 22: Connection refused
nmap -sSV -O -p 22 new.rhel.server (issued from my laptop) shows that port 22 is actually closed:
Starting Nmap 7.80 ( https://nmap.org ) at 2022-09-21 17:27 EDT Nmap scan report for new.rhel.server (220.127.116.11) Host is up (0.000051s latency). PORT STATE SERVICE VERSION 22/tcp closed ssh Too many fingerprints match this host to give specific OS details Network Distance: 0 hops OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 2.05 seconds
This has me stumped. Why would nmap show the port is closed while the server reports that the port is open?