Fedora: SSH connection refused

I am assuming you want to connect to the enp2s0f0 interface of the server (all other interfaces (except loopback) are DOWN).

From the logs you can see that DHCP requests on that interface are timing out. From the output of ip a you can see that the interface only has an IPv6 link-local address.

You should either fix DHCP or manually assign an IPv4 address to the interface (ip addr add x.x.x.x/24 dev enp2s0f0). Alternatively you can use IPv6.

EDIT: More questions:

  • Are the 2 machines directly connected?
  • Can you tell us more about the client? What do ip a, ip r, and iptables-save output on the client?
  • What does iptables-save output on the server? Note that iptables -vnL doesn't print all the rules.
  • Can you ping the server from the client? (e.g. ping 192.168.10.10)
  • Can you arp ping the server from the client? (e.g. arping -I eth0 192.168.10.10) do you get a reply? is the MAC address in the reply correct? (it should be 20:89:84:77:4b:2a).
  • If you run tcpdump on the server (tcpdump -n -i any port 22) and try ssh-ing in what does tcpdump output?

EDIT 2: Your client and server should have different IP addresses. Make the client 192.168.10.9 and the server 192.168.10.10.


I think that your rule is never reached because of the REJECT rule (just before), which is applied to all the packets that don't match preceding rules.

What happen if you use :

iptables-I INPUT 1-p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

(i.e. insert the rule at the beginning of the table)

Edit : some more suggestions

  • Check that sshd is actually listening :

    ss --tcp --listening -n -p
    
  • Add the -v option when showing the iptables (this adds a packet count for each rule, so that you can see which one are used)

  • try both IPv4 and IPv6 (with -4 and -6 options for the ssh command)


I think you're trying to connect to the wrong IP.

In the ss command you see something like 'Local Address' 192.168.122.1, but you try to connect to the IP 192.168.10.10.

Would you please give us the network configuration of the server? It would be enough if you paste the whole output of executing ip a in the server.