1

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.

Bon Ami
  • 883
  • 2
  • 10
  • 14
  • [Closely related question, *"Hide processes from other users based on groups under Linux*"](http://unix.stackexchange.com/questions/1326/hide-processes-from-other-users-based-on-groups-under-linux). ([NetBSD supports this, too, via `security.models.bsd44.curtain=1`](http://www.feyrer.de/NetBSD/bx/blosxom.cgi/index.front?-tags=ps)) Of course these things only hide the command line from *other non-privileged users*, you and `root` still see it. – sr_ Mar 15 '12 at 08:08
  • I am satisfied as long as non-privileged users cannot see it. – Bon Ami Mar 15 '12 at 08:17
  • Possible duplicate: [*"How to make a process invisible to other users?"*](http://unix.stackexchange.com/questions/17164/how-to-make-a-process-invisible-to-other-users) and [these links](http://unix.stackexchange.com/a/18917/11539). – sr_ Mar 15 '12 at 08:34
  • 2
    The coming 3.3 kernel can hide processes between users. See my answer [here](http://unix.stackexchange.com/a/34224/15241) – jofel Mar 15 '12 at 10:14

1 Answers1

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,438
  • 15
  • 18