Skip to content

Instantly share code, notes, and snippets.

@mrunalp
Created June 3, 2015 22:13
Show Gist options
  • Save mrunalp/0f65c8d9d5b709eb6642 to your computer and use it in GitHub Desktop.
Save mrunalp/0f65c8d9d5b709eb6642 to your computer and use it in GitHub Desktop.
unshare
unshare -Urm --mount-proc
@mrunalp
Copy link
Author

mrunalp commented Jun 3, 2015

@LK4D4 Does the --mount-proc option work for you?

@mrunalp
Copy link
Author

mrunalp commented Jun 3, 2015

Actually

unshare -Urm --mount-proc=/proc

@mrunalp
Copy link
Author

mrunalp commented Jun 4, 2015

[mrunal@localhost ~]$ unshare -Umprf --mount-proc=/proc sh
sh-4.3# 
sh-4.3# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 20:47 pts/2    00:00:00 sh
root         2     1  0 20:47 pts/2    00:00:00 ps -ef
sh-4.3# cat /proc/self/uid_map 
         0       1000          1
sh-4.3# id
uid=0(root) gid=0(root) groups=0(root),65534(nfsnobody) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
sh-4.3# exit
exit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment