Writing to Bind Mount Inside of an Unprivileged Container?

In an LXC container with Ubuntu 22.04 I had problems with the root user.
If I gave a command that required root permissions, such as
Code:
apt-get update
, it would give an error concerning the UID
I solved this by adding two lines in the container's conf file:

Code:
lxc.idmap = u 65534 165534 1
lxc.idmap = g 65534 165534 1

Is there a better way to do the same thing or is this correct?
 

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!