fix(cloud-init): add root user

This commit is contained in:
Matthieu Bessat 2024-07-05 17:04:25 +02:00
parent 27d94f4313
commit 7a1d11bea2
4 changed files with 9 additions and 14 deletions

View file

@ -1,5 +1,5 @@
# Auto setup of debian vm with cloud image + cloudinit method # Auto setup of debian vm with cloud image + cloudinit method
First download cloud generic image with `init.sh` First download cloud generic image with `init.sh` then `build_config.sh`.
Then `run.sh` Then `run.sh`

View file

@ -1,11 +1,13 @@
#cloud-config #cloud-config
hostname: jpplandhost hostname: sandboxvm
disable_root: false
groups: groups:
- jppland - sandbox
users: users:
- default - name: root
- calyjohn ssh_authorized_keys:
- name: mbess - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBeNeE0gk6mO0Bz9dDvKQrhA2Oo7x05FicCQJivxqIyi sandbox"
- name: demo
passwd: "$6$QQuYYEMEG0bJf7iH$mhFeXl10jSQhFO8ltMAi3CtoGLOz5tPdnEBTcp.4JzS5mnBbpANvm9s.VQFMvWq8nfzgzdDZMGr1hnZLGVd2V." #root passwd: "$6$QQuYYEMEG0bJf7iH$mhFeXl10jSQhFO8ltMAi3CtoGLOz5tPdnEBTcp.4JzS5mnBbpANvm9s.VQFMvWq8nfzgzdDZMGr1hnZLGVd2V." #root
sudo: ALL=(ALL) NOPASSWD:ALL sudo: ALL=(ALL) NOPASSWD:ALL
groups: sudo groups: sudo
@ -13,10 +15,3 @@ users:
lock_passwd: false lock_passwd: false
ssh_authorized_keys: ssh_authorized_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBeNeE0gk6mO0Bz9dDvKQrhA2Oo7x05FicCQJivxqIyi sandbox" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBeNeE0gk6mO0Bz9dDvKQrhA2Oo7x05FicCQJivxqIyi sandbox"
write_files:
- encoding: gzip
content: !!binary |
H4sIAIDb/U8C/1NW1E/KzNMvzuBKTc7IV8hIzcnJVyjPL8pJ4QIA6N+MVxsAAAA=
path: /usr/bin/hello
permissions: '0755'

View file

@ -8,6 +8,6 @@ qemu-system-x86_64 \
-hda ./debian-12-generic-amd64.qcow2 \ -hda ./debian-12-generic-amd64.qcow2 \
-drive driver=raw,file=./cloud-init-config/out/seed.iso,if=virtio \ -drive driver=raw,file=./cloud-init-config/out/seed.iso,if=virtio \
-net nic \ -net nic \
-net user,hostfwd=tcp::2222-:22 -net user,hostfwd=tcp::2322-:22
#-smbios type=1,serial=ds='nocloud;s=http://10.0.2.2:8000/' #-smbios type=1,serial=ds='nocloud;s=http://10.0.2.2:8000/'