1

I'd like to create new user namespace being root with the command:

# unshare -U bash
$ echo $$
3500
$ id
uid=65534(nobody) ... etc

After that I edit /proc/3500/uid_map im my initial namespace as root:

# echo "0 100000 65536" > /proc/3500/uid_map

My /etc/subuid file I've created:

root:100000:65536

Now when I'm back in newly created user namespace by unshare:

# exec bash
uid=65534 ... etc

still get nobody user. Is root not allowed to create mapping for himself? Or I'm doing something wrong? :)

pawel__86
  • 11
  • 2
  • IMHO Questions should demonstrate reasonable information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault. – djdomi Jul 20 '21 at 13:36

1 Answers1

0

If you want to be root within the new namespace, why not

unshare -Ur bash

?