Hi
If I create a new unprivileged Debian 12 container, I'm unable to create a new user with a home directory that can be owned by that user. Any help would be appreciated
Steps to recreate:
Here's the error:
My LXC config:
The above uid/gid mapping works fine in my other containers (copy pasted). Here's my sugid and subuid files:
If I create a new unprivileged Debian 12 container, I'm unable to create a new user with a home directory that can be owned by that user. Any help would be appreciated
Steps to recreate:
- Create a new Debian 12 unprivileged container
- Edit the LXC file (per below)
- Start it
- In the container:
- useradd -u 1000 -m --shell=/usr/bin/bash jayden
- usermod -aG sudo jayden
- apt install sudo
- passwd jayden
Here's the error:
Code:
root@actual:/home# ls -l
total 4
drwxr-xr-x 2 nobody nogroup 4096 Jan 5 07:58 jayden
root@actual:/home# chown -R jayden:jayden jayden/
chown: changing ownership of 'jayden/.bashrc': Operation not permitted
chown: changing ownership of 'jayden/.profile': Operation not permitted
chown: changing ownership of 'jayden/.bash_logout': Operation not permitted
chown: changing ownership of 'jayden/': Operation not permitted
My LXC config:
Code:
arch: amd64
cores: 1
features: nesting=1
hostname: actual
memory: 4098
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.1,hwaddr=BC:24:11:95:7A:89,ip=192.168.1.107/24,type=veth
ostype: debian
rootfs: datanvme0n1:vm-107-disk-0,size=8G
swap: 512
unprivileged: 1
lxc.idmap: u 0 100000 1000
lxc.idmap: g 0 100000 1000
lxc.idmap: u 1000 1000 1
lxc.idmap: g 1000 1000 1
lxc.idmap: u 1001 101001 64535
lxc.idmap: g 1001 101001 64535
The above uid/gid mapping works fine in my other containers (copy pasted). Here's my sugid and subuid files:
Code:
root:100000:65536
root:1000:1
Last edited: