UID mapping www-data
Zitat von mpachmann am 30. November 2022, 11:21 Uhrhttps://forum.proxmox.com/threads/unable-to-map-to-www-data-user-in-container.49695/
create user and group with ID 1005 on proxmox host
groupadd -g 1005 usergrp
useradd user -u 1005 -g 1005add rights to the proxmox host folder to mount into the LXC
chown user:usergrp ./mount/folder ( example: /ssd/ncstore1)/etc/pve/lxc/LXC-ID.conf add the lines
lxc.idmap: u 0 100000 33
lxc.idmap: g 0 100000 33
lxc.idmap: u 33 1005 1
lxc.idmap: g 33 1005 1
lxc.idmap: u 34 100034 65501
lxc.idmap: g 34 100034 65501/etc/subuid
root:100000:65536
root:1005:1
root:33:1/etc/subgid
root:100000:65536
root:1005:1
root:33:1if mapping www-data is not working, try
pct mount LXC-ID
find /var/lib/lxc/LXC-ID/rootfs -uid 100033 -exec chown 1005 '{}' \;
find /var/lib/lxc/LXC-ID/rootfs -gid 100033 -exec chgrp 1005 '{}' \;now the mounted folder into the LXC should not be owned by nobody:nogroup
https://forum.proxmox.com/threads/unable-to-map-to-www-data-user-in-container.49695/
create user and group with ID 1005 on proxmox host
groupadd -g 1005 usergrp
useradd user -u 1005 -g 1005add rights to the proxmox host folder to mount into the LXC
chown user:usergrp ./mount/folder ( example: /ssd/ncstore1)/etc/pve/lxc/LXC-ID.conf add the lines
lxc.idmap: u 0 100000 33
lxc.idmap: g 0 100000 33
lxc.idmap: u 33 1005 1
lxc.idmap: g 33 1005 1
lxc.idmap: u 34 100034 65501
lxc.idmap: g 34 100034 65501/etc/subuid
root:100000:65536
root:1005:1
root:33:1/etc/subgid
root:100000:65536
root:1005:1
root:33:1if mapping www-data is not working, try
pct mount LXC-ID
find /var/lib/lxc/LXC-ID/rootfs -uid 100033 -exec chown 1005 '{}' \;
find /var/lib/lxc/LXC-ID/rootfs -gid 100033 -exec chgrp 1005 '{}' \;now the mounted folder into the LXC should not be owned by nobody:nogroup