Ubuntu Cloud Image 20.04,cloud-init 错误

Ubuntu Cloud Image 20.04,cloud-init 错误

esxi 8.0,Ubuntu 20.04(focal)。我使用 hdiutil makehybrid -o cidata.iso cidata -iso -joliet 创建了 cidata.ico

用户数据内容:

#cloud-config
users:
  - name: demo
    groups: sudo
    shell: /bin/bash
    sudo: ALL=(ALL) NOPASSWD:ALL
    ssh-authorized-keys:
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACA... 

获得

[    5.671765] cloud-init[680]: 2022-11-02 01:06:00,248 - schema.py[WARNING]: Invalid cloud-config provided: Please run 'sudo cloud-init schema --system' to see the schema errors.

有什么方法可以让我查看有关此错误的更多详细信息?谢谢!

答案1

root@me:~# cloud-init schema --system
Cloud config schema deprecations: 
Error:
Cloud config schema errors: users.0: {'groups': 'sudo', 'name': 'demo', 'shell': '/bin/bash', 'ssh-authorized-keys': ['ssh-rsa AAAAB3NzaC1yc2EA'], 'sudo': 'ALL=(ALL) NOPASSWD:ALL'} is not valid under any of the given schemas

如果你看看cloud-init 文档,您会发现这ssh-authorized-keys不是有效密钥。它已被弃用并被替换ssh_authorized_keys

相关内容