View Categories

ssh: connect to host 192.168.10.211 port 22: Connection refused

1 min read

Installed Fedora and when trying to connect to the new Fedora operating system via SSH I get the error

Connection refused

So where to start?  First figure I should check to see if the service is running

ShellScript
[dennis@localhost ~]$ sudo systemctl status sshd
[sudo] password for dennis: 
 sshd.service - OpenSSH server daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-03-31 19:43:48 EDT; 55s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 1163 (sshd)
      Tasks: 1 (limit: 16972)
     Memory: 4.7M
        CPU: 79ms
     CGroup: /system.slice/sshd.service
             └─1163 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Mar 31 19:43:48 localhost.localdomain systemd[1]: Starting OpenSSH server daemon...
Mar 31 19:43:48 localhost.localdomain sshd[1163]: Server listening on 0.0.0.0 port 22.
Mar 31 19:43:48 localhost.localdomain sshd[1163]: Server listening on :: port 22.
Mar 31 19:43:48 localhost.localdomain systemd[1]: Started OpenSSH server daemon.
Mar 31 19:44:18 localhost.localdomain sshd[3159]: Accepted password for dennis from 192.168.10.180 port 57636 ssh2
Mar 31 19:44:18 localhost.localdomain sshd[3159]: pam_unix(sshd:session): session opened for user dennis(uid=1000) by (uid=0)
[dennis@localhost ~]$ 

If the service wasn’t running you can simply initiate the following command to get the ssh running

ShellScript
sudo systemctl start sshd

And you may want sshd to start automatically with a reboot and for that to happen you need to issue

ShellScript
systemctl enable sshd.service
Protected By
Shield Security