I have to execute a program that passes in as command line options the username and password. Is there a way to hide the username & password from appearing in the /proc entry for this process.
Asked
Active
Viewed 619 times
1
Bon Ami
- 893
1 Answers
2
If you you wrote the application or have access to the source code, you can modify it to not show that information in proc.
In C, the parameters passed to a program are communicated as a pointer to a character array (a pointer to a pointer to the characters). This array is modifiable by the application, and any modifications you make are reflected in the /proc/ entry. This includes the 0th element, which is the executable's filename.
Other languages have similar equivalents. Just modify the argument list through whichever mechanism the language implements.
tylerl
- 2,468
- 15
- 18
security.models.bsd44.curtain=1) Of course these things only hide the command line from other non-privileged users, you androotstill see it. – sr_ Mar 15 '12 at 08:08