Comment 15 for bug 2049860

Revision history for this message
John Chittum (jchittum) wrote :

Tested working on the image from http://cloud-images.ubuntu.com/releases/jammy/release-20240319/

$ ssh -o "UserKnownHostsFile=/dev/null -o CheckHostIP=no StrictHostKeyChecking no" jchittum@0.0.0.0 -p 2222
The authenticity of host '[0.0.0.0]:2222 ([0.0.0.0]:2222)' can't be established.
ED25519 key fingerprint is <REDACTED>
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[0.0.0.0]:2222' (ED25519) to the list of known hosts.
jchittum@0.0.0.0's password:
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-101-generic x86_64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/pro

  System information as of Mon Apr 1 11:55:56 UTC 2024

$ ls /etc/ssh/sshd_config.d/
50-cloud-init.conf 60-cloudimg-settings.conf

$ sudo cat /etc/ssh/sshd_config.d/50-cloud-init.conf
PasswordAuthentication yes

$ sudo cat /etc/ssh/sshd_config.d/60-cloudimg-settings.conf
PasswordAuthentication no

####

cloud-init and passwords is a bit confusing. here is a working example of a cloud-init:

#cloud-config
ssh_pwauth: true
users:
    - name: jchittum
      groups: [adm, lxd, sudo]
      passwd: <HASHED_PASSWORD>
      sudo: ALL=(ALL) NOPASSWD:ALL
      shell: /bin/bash
      lock_passwd: false
    - name: timmy
      groups: [adm, lxd, sudo, cdrom, dip]
      ssh_import_id: lp:jchittum
      sudo: ALL=(ALL) NOPASSWD:ALL
      passwd: <HASHED_PASSWD>
      shell: /bin/bash
      lock_passwd: false

NOTES:

passwd was set by running : mkpasswd --method=SHA-512 --rounds=500000
lock_passwd: false is _required_ to make this work. otherwise providing a password won't do anything, and you'll never be able to log in.

I'm wondering if it's from a different version of cloud-init instead?

20231211:
cloud-init 23.3.3-0ubuntu0~22.04.1

20240319:
cloud-init 23.4.4-0ubuntu0~22.04.1

i don't see anything related in the changelog[https://github.com/canonical/cloud-init/blob/main/ChangeLog]

next steps: try a coud-init config like i have above. If it fails, please provide your cloud-init and outputs (especially helpful with some cloud-init logs).