root user cannot run 'su' command - lxc container

Victor_240

New Member
Sep 26, 2024
2
0
1
Hello,

I have an unprivileged lcx container where I changed the UID mapping in the file /etc/pve/lxc/101.conf. The file looks like this now:

lxc.idmap: u 0 0 1
lxc.idmap: u 1 100000 65535
lxc.idmap: g 0 0 1
lxc.idmap: g 1 100000 65535
lxc.cgroup2.devices.allow: c 10:200 rwm

While I managed to get access to the mounted folder I was aiming for, I can't run any su command. I can't even change user with su - user.
When I try to run su - <user> I get:
su: cannot set groups: Operation not permitted

When I try to run sudo sysctl vm.swappiness=10, I get:
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/libexec/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins

Is there something I can do to rectify this?
 

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!