I am running a computer with Ubuntu 20.04 with encrypted root partition. As I want to be able to unlock the computer via network I tried to use Dropbear to achieve this (For what I did see below). Now I have the problem that once the computer is booted up NetworkManager refuses to connect to the wired network in the journal I see the following error.
NetworkManager[9449]: <info> [1591297428.2491] audit: op="connection-add-activate" pid=3815 uid=1000 result="fail" reason="Connection 'Kabelgebundene Verbindung 1' is not available on device enp3s0 because device is strictly unmanaged"
sudo nmcli
gives me
~$ LANG=C sudo nmcli
enp3s0: unmanaged
"Realtek RTL8111/8168/8411"
ethernet (r8169), AC:22:0B:74:FF:F3, hw, mtu 1500
enp4s0: unmanaged
"Realtek RTL8111/8168/8411"
ethernet (r8169), C4:6E:1F:04:8C:BD, hw, mtu 1500
lo: unmanaged
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536
So it seems that since the networks gets setup in the initramfs NetworkManager refuses to manage the interfaces. This seems to affect not only the one used for ssh but also enp4s0 and the loopback device.
Do you have any advice on how to fix this problem or another way to get cryptroot unlock via ssh without that problem?
What I did to enable cryptroot unlock via ssh
sudo apt install busybox dropbear
In /etc/initramfs-tools/initramfs.conf
I changed BUSYBOX=auto
to BUSYBOX=y
and added DROPBEAR=y
Then I copied my authorized_keys
file to /etc/dropbear-initramfs/
Finally I changed NO_START=1
to NO_START=0
in /etc/default/dropbear
and rebuild the initramfs with sudo update-initramfs -u
Update from Questions
The output of sudo journalctl -b 0 /usr/sbin/NetworkManager
is
-- Logs begin at Mon 2020-05-25 11:17:50 CEST, end at Mon 2020-06-08 10:44:15 CEST. --
Jun 08 10:41:45 lukas-desktop NetworkManager[1206]: <info> [1591605705.9675] NetworkManager (version 1.22.10) is starting... (for the first time)
Jun 08 10:41:45 lukas-desktop NetworkManager[1206]: <info> [1591605705.9675] Read config: /etc/NetworkManager/NetworkManager.conf (lib: 10-dns-resolved.conf, 10-globally-managed-devices.conf, 20-connectivity-u>
Jun 08 10:41:45 lukas-desktop NetworkManager[1206]: <warn> [1591605705.9676] config: unknown key 'wifi.cloned-mac-address' in section [device-mac-addr-change-wifi] of file '/usr/lib/NetworkManager/conf.d/no-ma>
Jun 08 10:41:45 lukas-desktop NetworkManager[1206]: <warn> [1591605705.9676] config: unknown key 'ethernet.cloned-mac-address' in section [device-mac-addr-change-wifi] of file '/usr/lib/NetworkManager/conf.d/n>
Jun 08 10:41:45 lukas-desktop NetworkManager[1206]: <info> [1591605705.9863] bus-manager: acquired D-Bus service "org.freedesktop.NetworkManager"
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.0014] manager[0x55d085fd8040]: monitoring kernel firmware directory '/lib/firmware'.
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.0014] monitoring ifupdown state file '/run/network/ifstate'.
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3059] hostname: hostname: using hostnamed
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3060] hostname: hostname changed from (none) to "lukas-desktop"
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3062] dns-mgr[0x55d085fbd290]: init: dns=systemd-resolved rc-manager=symlink, plugin=systemd-resolved
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3064] manager[0x55d085fd8040]: rfkill: Wi-Fi hardware radio set enabled
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3064] manager[0x55d085fd8040]: rfkill: WWAN hardware radio set enabled
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3131] Loaded device plugin: NMBluezManager (/usr/lib/x86_64-linux-gnu/NetworkManager/1.22.10/libnm-device-plugin-bluetooth.so)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3147] Loaded device plugin: NMWifiFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.22.10/libnm-device-plugin-wifi.so)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3166] Loaded device plugin: NMTeamFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.22.10/libnm-device-plugin-team.so)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3173] Loaded device plugin: NMAtmManager (/usr/lib/x86_64-linux-gnu/NetworkManager/1.22.10/libnm-device-plugin-adsl.so)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3179] Loaded device plugin: NMWwanFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.22.10/libnm-device-plugin-wwan.so)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3182] manager: rfkill: Wi-Fi enabled by radio killswitch; enabled by state file
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3183] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3184] manager: Networking is enabled by state file
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3185] dhcp-init: Using DHCP client 'internal'
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3200] settings: Loaded settings plugin: ifupdown ("/usr/lib/x86_64-linux-gnu/NetworkManager/1.22.10/libnm-settings-plugin-ifupdown.so")
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3200] settings: Loaded settings plugin: keyfile (internal)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3201] ifupdown: management mode: unmanaged
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <warn> [1591605706.3202] ifupdown: interfaces file /etc/network/interfaces doesn't exist
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3216] device (lo): carrier: link connected
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3218] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3222] device (enp3s0): carrier: link connected
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3225] manager: (enp3s0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3236] manager: (enp4s0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/3)
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <warn> [1591605706.3247] Error: failed to open /run/network/ifstate
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3294] modem-manager: ModemManager available
Jun 08 10:41:46 lukas-desktop NetworkManager[1206]: <info> [1591605706.3295] manager: startup complete
Jun 08 10:42:16 lukas-desktop NetworkManager[1206]: <info> [1591605736.0553] agent-manager: agent[d99b11357d82f71a,:1.68/org.gnome.Shell.NetworkAgent/1000]: agent registered
Jun 08 10:43:57 lukas-desktop NetworkManager[1206]: <info> [1591605837.3307] audit: op="connection-add-activate" pid=1927 uid=1000 result="fail" reason="Connection 'Kabelgebundene Verbindung 1' is not availabl>
I hit this and started reading the networking
initramfs-tool
scripts. Noticed that it was adding entries into/run/netplan/<network-device>.yaml
That lead me here: What is creating /run/netplan/eth0.yaml? Though the original poster solved with a script in/etc/initramfs-tools/scripts/init-bottom
that removed the files that were added, I took the advice of first answer and did the following:to make sure that key in that file would override anything in
/run/netplan/<netowrk-device>.yaml
I hope this helps.