ssh connection refused on Linux Fedora 37 / Centos 9 / RHEL9?

ssh connection refused on Linux Fedora 37 / Centos 9 / RHEL9?

Checking ssh connection using target ip address,

[test_user@fedora ~]$ ssh root@172.158.0.113

ssh connection failed with below error.

ssh: connect to host 172.158.0.113 port 22: Connection refused

Lets check the sshd service status,

[test_user@fedora ~]$ sudo systemctl status sshd

sshd service disabled,

   sshd.service - OpenSSH server daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:sshd(8)
             man:sshd_config(5)

Enable the sshd service,

[test_user@fedora ~]$ sudo systemctl enable sshd

Lets check the status of sshd service whether service enabled or not,

[test_user@fedora ~]$ sudo systemctl status sshd
  sshd.service - OpenSSH server daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:sshd(8)
             man:sshd_config(5)

service sshd is inactive, need to activate using start command,

[test_user@fedora ~]$ sudo systemctl start sshd

Now recheck sshd service status,

[test_user@fedora ~]$ sudo systemctl status sshd

sshd service should be enabled and active now,

  sshd.service - OpenSSH server daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: disabled)
     Active: active (running) since Mon 2023-03-20 01:45:55 IST; 1s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 30563 (sshd)
      Tasks: 1 (limit: 9237)
     Memory: 2.2M
        CPU: 14ms
     CGroup: /system.slice/sshd.service
             30563 \"sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups\"

Mar 20 01:45:55 fedora systemd[1]: Starting sshd.service - OpenSSH server daemon...
Mar 20 01:45:55 fedora sshd[30563]: Server listening on 0.0.0.0 port 22.
Mar 20 01:45:55 fedora sshd[30563]: Server listening on :: port 22.
Mar 20 01:45:55 fedora systemd[1]: Started sshd.service - OpenSSH server daemon.

Now try ssh connection again,

[test_user@fedora ~]$ ssh root@172.158.0.113

Prompts password for root user,

The authenticity of host '172.158.0.113 (172.158.0.113)' can't be established.
ED25519 key fingerprint is SHA256:IgnFVomHAekUFIBh//ffVu5KkYwj52/Dml8vVo47ZyQ.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added \'172.158.0.113\' (ED25519) to the list of known hosts.
root@172.158.0.113's password: 



1 device has a firmware upgrade available.
Run `fwupdmgr get-upgrades` for more information.

There were 24 failed login attempts since the last successful login.

ssh connection worked once this service sshd is enabled and active,




Python installation

Privacy Policy  |  Copyrightcopyright symbol2020 - All Rights Reserved.  |  Contact us   |  Report website issues in Github   |  Facebook page   |  Google+ page

Email Facebook Google LinkedIn Twitter
^