scripts/setid

19 lines
436 B
Python
Executable file

#!/usr/bin/python
# Set up subuid and subgid for rootless Podman
# https://wiki.archlinux.org/title/Podman#Set_subuid_and_subgid
ids = ''
for uid in range(1000, 2000):
start = (uid - 999) * 10**5
num = 65536 # Allocate 65536 UIDs
ids += str(uid) + ':' + str(start) + ':' + str(num) + '\n'
# Save to system files
with open('/etc/subuid', 'w') as f:
f.write(ids)
with open('/etc/subgid', 'w') as f:
f.write(ids)