Bug 1214480 - cloud-init: unwanted/undocumented sles user is generated and opensuse credentials are not upgraded after second cloud-init initialization
Summary: cloud-init: unwanted/undocumented sles user is generated and opensuse credent...
Status: NEW
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Cloud:Images (show other bugs)
Version: Leap 15.5
Hardware: x86-64 Ubuntu
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: SUSE Public Cloud Maintainer
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-22 22:29 UTC by Matías Pecchia
Modified: 2023-08-26 18:33 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matías Pecchia 2023-08-22 22:29:10 UTC
1) Download Leap 15.5 - Minimal Virtual Machine - Cloud image AMD64
https://get.opensuse.org/leap/15.5/?type=server#download
aeffccb223bae45c5a60dad632b487cfb7cb91ed6518af3ed7d84e1eb3e49dab
openSUSE-Leap-15.5-Minimal-VM.x86_64-Cloud.qcow2
2) Setup a KVM virtual machine based in the downloaded drive with a cloud-init drive. with default user and one specific password ( in this example OpenSuse2023! ). Here some files:
```yaml user-data
#cloud-config
hostname: opensuse-see-if-user-is-created
manage_etc_hosts: true
password: $5$QnrWSOwo$1KtDoVEtEr/YhpmXbbv86aiIHs01Py2U12VnfUlLr82
ssh_authorized_keys:
  - ssh-rsa AAAA...NVw== foo@bar
chpasswd:
  expire: False
users:
  - default
package_upgrade: true

```

```yaml meta-data
instance-id: beeffcaaaaaaaaaaaaaaaaaaaaaffffffffffffe
```
3) Start the virtual machine, a zypper system upgrade is going to be triggered,
4) log in as opensuse user - wait cloud init ends ( in the shell `cloud-init status --wait` )
5) shutdown the VM
6) change the password for the user in the cloud-init drive, ( instance-id in meta-data must be new, password:$5$QnrWSOwo$LFAID334vgbKuy/jIXlllfe79fDvi8U.3iuvTswDiuD is OpenSuse2023!2 password ),
7) start the VM
8) You will have 2 users available: the opensuse one and sles.
Steps 2) to 5) might be part of some automatic template generation ( as packer ).
This problem might be present in other images as EC2 or Azure one.
Let me know if you need further information,

Regards,
Comment 1 Matías Pecchia 2023-08-22 22:30:49 UTC
I left a draft of solution in OBS.
https://build.opensuse.org/request/show/1104687