[SOLVED] re-acquire access to container

wbk

Active Member
Oct 27, 2019
195
24
38
Hi all,

I locked myself out of a container.

The container runs Debian with Yunohost; it was installed with a sudo account and root login disabled.

One way or another both my accounts with sudo have no sudo anymore after an unexpected power cut. User accounts are managed via LDAP on the container itself.

Once I have access to the containers web-interface for managing Yunohost, I might get any further, but networking does not come up.

I don't know how to continue from here. What I tried:
* mount the container in Proxmox and chroot into it to set a password for root. It gives Authentication Token Manipulation Error when running
Code:
passwd
. This has probably to do with chroot options, with which I am not familiar.
* try to get dumped in single user mode: I don't know how to trigger that for a container.

I do have a backups, but I don't know which files I need to replace to get (LDAP-provided?) sudo filewise.

Is there a way out of this situation and into the system?
 
Last edited:
Hi,

Is there a way out of this situation and into the system?
You should be able to get a root shell inside the container using pct enter <vmid>. This command must be executed as root on the PVE host. With that, you should be able to re-configure networking, /etc/sudoers etc.

Hope this helps!
 
  • Like
Reactions: wbk
Wohoo, thanks so much, that did the trick!

I totally forgot about pct, I'll use it more often :-)
 
Great to hear that did it!

Please just mark the thread as SOLVED by editing the first post, so that others with the same problem can find it more easily in the future! :)
 
  • Like
Reactions: wbk

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!