Skip to content

Instantly share code, notes, and snippets.

@sargun
Created August 27, 2021 03:51
Show Gist options
  • Save sargun/2a3d9afdd0d8fe9232394adbe5d8e315 to your computer and use it in GitHub Desktop.
Save sargun/2a3d9afdd0d8fe9232394adbe5d8e315 to your computer and use it in GitHub Desktop.
root@ubuntu:~# strace -e trace=unshare -e 'signal=!all' unshare --uts
unshare(CLONE_NEWUTS)                   = 0
root@ubuntu:~# strace -e trace=sethostname -e 'signal=!all' hostname foo
sethostname("foo", 3)                   = 0
+++ exited with 0 +++
root@ubuntu:~# 
root@ubuntu:~# hostname
foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment