It’s just interesting if there is a way to protect environment variables in the * nix system so that they cannot be read from any text file, but are available in the environment.
I know that we can always use file system permissions for .bashrc / .bash_profile, but what if certain variables (like db passwords) should be completely hidden?
One way to do this is to write some kind of / perl script program for:
Is there any other better and more obvious way to achieve this?
Thank!
-Gaurav
In no case. Even if you hide it from a text file, it is still available from /proc/<pid>/environ(linux) or ps e(another unix).
/proc/<pid>/environ
ps e
Who are you protecting them with?
: "". , , . ? "vim"? , , .
, . , , , . /proc/###/environ , , .
/proc/###/environ
, , , , - , / , , . ( - ), .
, -, / CGI Apache, : group apache:apache, , CGI, , apache:apache , rw-r----- (640). , , - , root, apache, apache.
apache:apache
rw-r-----
640
root
apache
, , , .