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

rnmkr

Member
Mar 10, 2019
13
2
8
30
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.
 
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:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!