[SOLVED] re-acquire access to container

wbk

Renowned Member
Oct 27, 2019
201
26
68
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