set-subuid-subgid 308 B

12345678910
  1. #!/usr/bin/env bash
  2. users=$(for s in /home/*; do echo "${s##*/}"; done)
  3. subuid_start=100000
  4. incr=65536
  5. for user in ${users[@]}; do
  6. uid=$(id -u "$user")
  7. echo "$user:$subuid_start:$incr" >> /etc/subuid
  8. echo "$user:$subuid_start:$incr" >> /etc/subgid
  9. subuid_start=$((subuid_start + 100000))
  10. done