Set up Ubuntu Core after a firewall

Ubuntu Core disables the physical console by default, so we need to SSH to the device with Ubuntu SSO account while setting up a Ubuntu Core device. However, my testing Ubuntu Core device is behind a firewall, and it looks like the SSH doesn’t go through the firewall. Is there a configuration like https_proxy we can specify while building the Ubuntu Core image, so that the device setup can be done behind a firewall? or, how do we set up a Ubuntu Core device behind a firewall? Thanks.

If you create a custom image using your own model definition. You can reuse the same kernel and gadget snaps as the standard model definition, so you won’t miss out on the standard updates by doing this. You can then create a system-user assertion signed with the same authority key as the model definition.

Once you’ve made and signed your assertions, you need to do:

  1. Build your custom image using ubuntu-image snap.
  2. write the disk image to your computer/device.
  3. Copy the signed system-user assertion to a USB thumb drive (or other removable storage device), calling the file auto-import.assert in the root directory of the drive.
  4. Plug the USB drive into the device, and boot it up. Once the system installs itself, it will load the assertion and create the user account with the requested password. At this point, you can unplug the USB drive.

You should now be able to log in as the user you created using the encrypted password from the assertion.

You can reuse the USB drive on multiple systems if you want the same user account. Alternatively, you can load different system-user assertions on different devices flashed with the same custom Ubuntu Core image if you want different user accounts.

1 Like

alternatively, if you can ssh in once after setup (i.e. do the setup procedure at your desk):

sudo passwd $USER

will allow you to set a password and should then automatically switch the physical console to a login prompt right afterwards

@jamesh, thanks for coaching. Though I still fail to specify the encoded password in my system-user assertion, but the auto-import.assert generated using the make-system-user snap works as you described. We should be able to provision our devices behind a firewall, thank you!

Though the use of make-system-user snap is straight forward, would you also educate me how to generate the encoded password to generate the auto-import.assert manually? Thanks.

Regards,
Tonny

Thank you @ogra! The problem for us is that our development and validation are all behind the company firewall. In our lab, testing devices don’t have direct Internet connections to log in to Ubuntu SSO. The system-user approach mentioned by @jamesh seems the only one solution for now. Thanks for comments, anyway!

Regards,
Tonny