4

This is my cloud-init

#cloud-config
package_update: true
package_upgrade: true
users:
  - name: sammy
    ssh-authorized-keys:
      - ssh-rsa abcd
      - ssh-rsa efgh

after i successfully run it on ubuntu 22.04 vps i checked

I see this when i do sudo tail /var/log/cloud-init-output.log

2022-06-07 08:37:38,353 - schema.py[WARNING]: Invalid cloud-config provided:
users.0: {'groups': 'sudo', 'name': 'sammy', 'shell': '/bin/bash', 'ssh-authorized-keys': ['ssh-rsa abcd', 'ssh-rsa defg\n'], 'sudo': ['ALL=(ALL) NOPASSWD:ALL']} is not valid under any of the given schemas

What did I do wrong? and how do I fix the warning? The cloud-init was correctly executed though.

1 Answers1

7

If you look at the docs, the key name is ssh_authorized_keys rather than ssh-authorized-keys. The latter is deprecated, though it looks like a deprecation warning was missed.

This should work with no warnings:

#cloud-config
package_update: true
package_upgrade: true
users:
  - name: sammy
    ssh_authorized_keys:
      - ssh-rsa abcd
      - ssh-rsa efgh
falcojr
  • 556