CodexBloom - Programming Q&A Platform

SSH Connection Timeout guide with Ubuntu 22.04 LTS on Custom Network Configuration

👀 Views: 0 💬 Answers: 1 📅 Created: 2025-08-06
linux ssh ubuntu networking bash

I've been struggling with this for a few days now and could really use some help... I'm updating my dependencies and I'm experiencing a frustrating scenario when trying to establish an SSH connection to my Ubuntu 22.04 LTS server. After modifying the network settings to use a static IP configuration, SSH connections began timing out. The configuration in `/etc/netplan/01-netcfg.yaml` looks like this: ```yaml network: version: 2 ethernets: ens33: dhcp4: no addresses: - 192.168.1.100/24 gateway4: 192.168.1.1 nameservers: addresses: - 8.8.8.8 - 8.8.4.4 ``` After applying the changes using `sudo netplan apply`, I can ping the server using its new static IP, but SSH connections return the following behavior after a few seconds: ``` ssh: connect to host 192.168.1.100 port 22: Connection timed out ``` I checked the SSH service with `sudo systemctl status ssh` and it shows that the service is active and running without errors. The firewall settings seem to allow connections on port 22: ```bash sudo ufw status ``` The output is: ``` Status: Active To Action From -- ------ ---- 22/tcp ALLOW Anywhere 22/tcp (v6) ALLOW Anywhere (v6) ``` To troubleshoot further, I've attempted restarting the SSH service with `sudo systemctl restart ssh` but that hasn’t resolved the scenario. Additionally, I've verified that the SSH daemon is listening on the correct port by running: ```bash sudo netstat -tuln | grep :22 ``` This command returns: ``` tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN ``` I’ve also tried connecting from different devices in the same network to rule out client-side issues. Any insights or suggestions on what might be causing this timeout scenario would be greatly appreciated. Thank you! For context: I'm using Bash on Ubuntu 20.04. I'd really appreciate any guidance on this. For reference, this is a production CLI tool. Am I missing something obvious? The stack includes Bash and several other technologies. What am I doing wrong?