[SOLVED] How to enable ssh password authentication in cloud init configuration?

rnmkr

Member
Mar 10, 2019
13
4
8
31
Hi, I've followed https://pve.proxmox.com/wiki/Cloud-Init_Support this document to create cloud init based template. However even though i setup cipassword , password based ssh authentication still not enabled. I get permission denied public key error.

If I turn on this image and disable ssh key login and then convert it to template would it be safe? I don't know it would be clean image after I turn on.
 
  • Like
Reactions: emoxam
Finally got it working by applying custom yaml config for cloud init. Make sure you delete my comments from file.

Save the file at /var/lib/vz/snippets/100.yaml then attach it like qm set 100 --cicustom "user=local:snippets/100.yaml"

YAML:
#cloud-config
users:
  - name: ubuntu
    shell: /bin/bash
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh_pwauth: True ## This line enables ssh password authentication
chpasswd:
  list: |
    ubuntu:ubuntu ## Overriding default username, password
  expire: True ## Forcing user to change the default password at first login
 
Last edited:
  • Like
Reactions: m4vr0x