If you are having problems creating a working network keyfile or importing the keyfile, this alternate method might work for you. It could also be that you have some other problem so this is not a "cure-all" for your wifi/network issues.
This is not the same access as using the ssh addon. The connection to the host happens on port 22222 and requires that you import an authorized_keys file to your system as described here: https://developers.home-assistant.io/docs/en/hassio_debugging.html
Or, you could connect a keyboard and monitor to your device running HassOS and connect to the host that way.
Once connected, login as 'root'. (Hit enter if you have connected directly to your device to interrupt the output you see.) You will arrive at the Hass.io custom command line interface (cli). You need to use 'login' here to continue on to the host system.
You should be sitting at a #
prompt.
You will now reset your network back to default, to clear out any other attempts and profiles you have made.
The following commands
- Clear the system-connections directory (where your keyfiles are imported to).
- Copies the default profile to the same directory.
- Reloads the network manager.
$ rm /etc/NetworkManager/system-connections/*
$ cp /usr/share/system-connections/* /etc/NetworkManager/system-connections/
$ nmcli con reload
nmcli
- shows you your connections and ip and dns infonmcli con show
- shows your connections. Green = connected (but not neccesarrily reachable)nmcli d
- shows you your network devices
You can search for other nmcli commands on the internet. There's a lot of cool stuff, but the important one is next...
nmcli device wifi connect YOUR_SSID password YOUR_WIFI_PASSWORD
This will try to connect to your SSID and will generate a network profile for you, which you can then check on using the previously provided nmcli commands.
If you use ls /etc/NetworkManager/system-connections
you should see at least two network profiles.
One for default and another for your wifi connection.
You can use cat YOUR_WIFI_PROFILE
to check the contents of your file.
And that's it. Hopefully you have your wifi connection now (but...why? Why are you using wifi for a server?!) and you also know how to reset and locate the files that are in play here. Have fun!