Knowledge Base

Forum-Breadcrumbs - Du bist hier:Knowledge BaseLinux: ProxmoxUID mapping www-data
Bitte , um Beiträge und Themen zu erstellen.

UID mapping www-data

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 1005

add 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:1

if 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