Hiding process arguments from ps -ef

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Hiding process arguments from ps -ef

    Hello,

    Is there an easy way to make the argument list of the process
    (X) not show up when running 'ps -ef' or similar? I can do that
    by making the calling process (P) pass arguments by other means
    (e.g. through a temporary file that X will read and erase) but
    if there is a standard way to do that from within the process X
    it would be better.

    If it matters, P is a perl script, X is a C++ program, running
    on solaris.

    Suggestions are appreciated!

    --
    Best regards,
    Alex
    Alex Meov Guest

  2. Similar Questions and Discussions

    1. CFFILE upload error - The process cannot access the filebecause it is being used by another process
      I get this error intermitently when trying to upload a file. <cffile action='upload' ... To make sure there was nothing wrong with the file, i...
    2. #37998 [Asn->Fbk]: Parent process lost MySQLi connection after child process gone
      ID: 37998 Updated by: tony2001@php.net Reported By: dbs at is dot ua -Status: Assigned +Status: ...
    3. Problem: Process.GetProcessesByName : Couldn't get process information from remote machine
      As part of an ASP.NET application, I am creating an Excel spreadsheet using my .NET component. On my machine (win2K) I always get a...
    4. hiding switches against a process
      Hi there I am trying to hide switches used to start a process so that they are not visible via a process listing. ie if a process is started ...
    5. hiding process from "ps" command
      On Mon, 14 Jul 2003 21:31:36 +0000, ajay wrote: I know of no way to do so on the UNIX flavors I support. I certainly hope no UNIX...
  3. #2

    Default Re: Hiding process arguments from ps -ef

    On Sun, 13 Jul 2003 22:42:50 +0000, Alex Meov wrote:
    > Is there an easy way to make the argument list of the process (X) not
    > show up when running 'ps -ef' or similar? I can do that by making the
    > calling process (P) pass arguments by other means (e.g. through a
    > temporary file that X will read and erase) but if there is a standard way
    > to do that from within the process X it would be better.
    There is no standard way for a process to change the program name and
    arguments reported by ps(1). By "standard" I mean a method that will
    work on any UNIX implementation that claims to conform to a published
    specification. I don't know whether or not there is a Solaris specific
    mechanism for achieving your goal.

    The only portable method for doing this is for the process in question
    to re-exec() itself. Of course, this isn't really a solution since there
    is a small window of time during which the arguments are visible. Too,
    note that even if your OS (e.g., Solaris) provides a mechanism for a
    process to change its command line arguments the race condition is still
    present. Between the time the program is exec()'ed and it changes its
    command line someone may run ps(1) and view the original command line.
    Rather than rely on a mechanism for changing the command line you should
    redesign the information passing mechanism so that sensitive information
    isn't passed via the command line.

    Kurtis D. Rader Guest

  4. #3

    Default Re: Hiding process arguments from ps -ef

    Alex Meov wrote:
    >
    > Hello,
    >
    > Is there an easy way to make the argument list of the process
    > (X) not show up when running 'ps -ef' or similar? I can do that
    > by making the calling process (P) pass arguments by other means
    > (e.g. through a temporary file that X will read and erase) but
    > if there is a standard way to do that from within the process X
    > it would be better.
    >
    > If it matters, P is a perl script, X is a C++ program, running
    > on solaris.
    >
    > Suggestions are appreciated!
    >
    > --
    > Best regards,
    > Alex
    What always works for me is to connect the stdout of one program
    to the stdin of the other. Anything I want to hide is sent
    through this link.

    --
    Fletcher Glenn
    email [email]f-g-l-e-n-n@quest.com[/email] (remove the dashes)
    Fletcher Glenn Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139