Score:2

Can't connect SSH on static IP address

eg flag

I have a default Ubuntu Server 22.04 installation (haven't done anything on it yet). SSH is working fine with default configuration on server's dynamic local IP.

I then set up a new netplan configuration file with static IP as seen here : https://ubuntu.com/server/docs/network-configuration

Here is my netplan configuration file /etc/netplan/99_config.yaml :

  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      addresses:
        - 172.26.50.150/24
      routes:
        - to: default
          via: 172.26.50.1
      nameservers:
          search: [example.com, sales.example.com, dev.example.com]
          addresses: [172.26.50.30, 172.26.50.50]

I then use sudo netplan apply to apply the configuration. Which works as the DHCP ip is not responding anymore, and the new IP pings well.

However :

  • I'm not able to connect SSH on the new static IP
  • If I revert the netplan configuration to the original DHCP one, SSH is working again

My SSH config file is the default openssh-server one, with no limitation (ListenAddress etc...)

I tried to sudo apt-get purge openssh-server and then sudo apt-get install openssh-server as another topic on the internet suggests but I'm still having the same issue.

I tried to have a netplan conf that allow DHCP + Static IP, and while both IP respond properly on the network, only DHCP's IP would allow SSH connections.

What am I missing ?

Score:1
eg flag

I found out I had a duplicate IP on my network, so whenever I was trying to connect to my Ubuntu server I was in fact trying to connect a Windows server that would refuse any SSH attempt. Ashamed but relieved, everything is working fine with another IP address.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.