autoinstall/user-data's users section does not work at all?

Solution 1:

This worked for me using the 20.04.3 server installer (subiquity 21.08.2)

#cloud-config
autoinstall:
  # r00tme
  user-data:
    users:
      - default
      - name: kim
        passwd: $6$.c38i4RIqZeF4RtR$hRu2RFep/.6DziHLnRqGOEImb15JT2i.K/F9ojBkK/79zqY30Ll2/xx6QClQfdelLe.ZjpeVYfE8xBBcyLspa/
        lock_passwd: false
        shell: /bin/bash
        groups: [adm,sudo]
  ssh:
    allow-pw: true
    authorized-keys: []
    install-server: true

A few key points

  • this will create the default user, ubuntu, that has no password. It will also create a second user, kim, with the given password hash.
  • the users do not get created until the first boot. The installer adds configuration for cloud-init to create the users.
  • the groups had to be in YAML list syntax.
  • I did not include an identity section.