First, I presume that if this is possible it would need to be done as root (or as a user who shares root's UID of 0).

How can a process be launched so that it does not show up in a ps aux or ps ef or top listing if the command is run by non-root?

Is this even possible?

The distributions I typically run are RHEL/CentOS and Ubuntu - so if there is a distro-specific answer, that's ok, too.

link|improve this question

warren: Ever find a solution to this? – Chris Nov 15 '10 at 14:41
@Chris - nope... @fianchetto's answer seems to be the only route, and that's a lot more work than I'm comfortable undertaking :-| – warren Nov 15 '10 at 15:59
I am going to undertake this project and will report back with anything I determine. – Chris Nov 15 '10 at 17:32
feedback

1 Answer

up vote 2 down vote accepted

Well, you have a couple of options here. Taking the easy way out would be to swap the ps and top programs out with modified versions that hide what it is you want to hide.

The alternative would be to run your code embedded in an existing process, or write a wrapper-script around your code with an innocuous name.

In some versions of PS, you can modify it by changing argv[], but not sure if that works for top, and not sure if it works in linux (It's mainly a BSD convention).

It all depends, on exactly what you are looking to achieve by doing this?

link|improve this answer
my goal here is for processes spawned by root to not be visible to all users (perhaps security-related daemons or similar) – warren Oct 13 '10 at 19:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.