0

As I was experimenting with various things I deleted the file /etc/netplan/50-cloud-init.yaml. Now I can't get any network (ethernet or wifi) to connect. So I can't ssh to fix things. I am on Ubuntu Server 20.02. I can't even find a terminal (shell) app in the default gui. Help?

1
  • 2
    the best advice would be to restore your most recent backup ... Jun 4, 2021 at 0:31

1 Answer 1

1

Easily done and its good to play..

Login to your machine via the console.. and use your editor of choice to edit /etc/netplan/50-cloud-init.yaml.

network:
    version: 2
    ethernets:
        eth0:
            dhcp4: true
            match:
                driver: bcmgenet smsc95xx lan78xx
            optional: true
            set-name: eth0
wifis:
    wlan0:
      optional: true
      dhcp4: true
      access-points:
         <Your ESSID>:
           password: <Your Pass-Phrase>

Then run..and check and fix any syntax/errors

netplan generate

Once that command is happy run:-

netplan apply

You should have networking back..

6
  • 1
    Fantastic. Does that lead to the same or a different result than doing $ sudo nmcli d wifi connect "said" password "pwd"?
    – pitosalas
    Jun 4, 2021 at 11:28
  • 1
    Also you need a colon after <your ssid> and I think you need password: before the password.
    – pitosalas
    Jun 4, 2021 at 12:48
  • Yes sorry vagaries of cut-n-paste.. Have updated.. Jun 4, 2021 at 14:18
  • I'm not using network manger on my ubuntu boxes.. so I don't even have nmctl running.. The idea with netplan is its the single wrapper around all networking.. Jun 4, 2021 at 14:19
  • You can add multiple unique <Your ESSID>: on separate lines if that helps Jun 4, 2021 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.