通过unshare探索Linux namespaces

unshare [options] program [arguments]

  • run program with some namespaces unshared from parent(使用与父程序不共享的名称空间运行程序)

unshare 命令描述

Unshares the indicated namespaces from the parent process and then executes the specified program. The namespaces to be unshared are indicated via options.
Unshare取消共享父进程中指定的命名空间,然后执行指定的程序。要取消共享的命名空间通过选项来指示。不可共享的命名空间有

支持设置的namespace

  • mount namespace
  • UTS namespace
  • IPC namespace
  • network namespace
  • pid namespace
  • user namespace

参考资料