Let's say I export FOO=var in a shell.

What would it take for someone else, root or other, to detect that the key of this variable has been set, and maybe even learn the value of it?


1 Answer 1


Root can literally read all your processes' memory. It will take them no effort at all; they can just halt the process for which that variable is set (in your case, your shell), and execute the libc function to get the value of the variable, or directly read the memory *envp themselves.

You literally cannot keep a secret from root, as long as that secret is accessible by your software. That's by hardware design, effectively.

Someone else is generally, on unixoids, not supposed to read the environment of one of your processes. There's access to these on much older versions of non-Linux UNIXoids, but I don't think you care about 1990's AIX?

Not the answer you're looking for? Browse other questions tagged .