Feature Request: API endpoint to change LXC container root password

zerlix

New Member
Mar 29, 2024
1
1
3
Bad Camberg, Germany
Hello,


there is currently no API endpoint to change the root password of an existing LXC container.


Current situation:
  • When creating an LXC container via POST /nodes/{node}/lxc, the password parameter works as expected.
  • For KVM/QEMU guests, password changes are possible via the Guest Agent.
  • For existing LXC containers, the only available method is using pct exec or lxc-attach directly on the node, which requires SSH access.

Problem:
When managing multiple Proxmox clusters via the API, there is no clean way to automate password changes for LXC containers without SSH access to every node. This is inconsistent with KVM and complicates integration with external management tools.


Proposal:
Add a dedicated API endpoint, for example:
POST /nodes/{node}/lxc/{vmid}/password

Alternatively, allow the password parameter to be set via:
PUT /nodes/{node}/lxc/{vmid}/config also for running containers.

Internally, this could simply execute chpasswd inside the container, similar to what pct exec already does.

Benefits:
  • Consistent API behavior between KVM and LXC
  • Password management without SSH access to nodes
  • Easier automation in larger environments

Best regards
 
  • Like
Reactions: MagicFab