API created Centos7 virtual machine automatically changes password

1740591175

New Member
Dec 7, 2023
2
0
1
Sorry, my English is not very good,I created a Centos7 virtual machine using an API and configured the username as root and password as 123456 using cloud init. However, after a period of time, my root password becomes invalid and I am unable to log in to the system using the set root password. What is the reason for this1701913295991.png1701913319264.png
 
Last edited:
There is no reason that this happens which can be attributed to the Hypervisor.

It could be due to how your image was created and what policies are in place.
It could be because of the packages you subsequently install.
It could be someone messing with you.

Take a look at this and other similar discussions: https://superuser.com/questions/150675/how-to-display-password-policy-information-for-a-user-ubuntu
Create another user with sudo privilege, so you can login when you get locked out and examine you log and /etc/shadow

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
There is no reason that this happens which can be attributed to the Hypervisor.

It could be due to how your image was created and what policies are in place.
It could be because of the packages you subsequently install.
It could be someone messing with you.

Take a look at this and other similar discussions: https://superuser.com/questions/150675/how-to-display-password-policy-information-for-a-user-ubuntu
Create another user with sudo privilege, so you can login when you get locked out and examine you log and /etc/shadow

Good luck


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
My Centos image was downloaded from the Centos official website and comes in the QCOW2 format of cloud init. I first used this image to create a virtual machine and then modified the cloud init configuration and SSH_ The value of pwauth is 1, and then I shut down the virtual machine and packaged the system disk into a new qcow2 image. I created a virtual machine using this new image and initialized the username and password using cloud init. Later, I encountered the problem of automatically changing the root password that I mentioned earlier, and the password changed was not 123456 that I set
 
Last edited:
So you took the official image where root login is disabled, booted it - meaning some portions of the CloudInit that are supposed to run only once - ran. Then you created, essentially, a custom config. It's unclear if you properly initialized the image so it looks fresh when booted again. And the end result is that your custom image is not working properly.

There is no evidence that your problems have anything to do with a hypervisor/PVE.

I'd recommend not modifying official image, but rather making any needed changes through "custom" CloudInit. "Custom" is in quotes as its a PVE configuration term. Essentially its normal full cloudInit interface that one would use with any Cloud.

If you feel that you must have custom image, either make sure you properly initialize it or use virt-edit to make modifications, without booting it.

Keep experimenting, good luck

PS dont use passwords - use SSH keys


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 

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!