Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On Linux how can I change EUID of running process from command line (provided I have root access)?


share|improve this question
up vote 1 down vote accepted

I don't think you can, I am not aware of any syscall that lets you change the effective user id of any process but the calling process.

share|improve this answer

There's kchuid, but that requires you to compile your own kernel modules, was last updated in 2002, and looks extremely feary.

Alternatively, you could do probably do some ptrace hacks, but a sample or direction is bit beyond me.

share|improve this answer

Use gdb.

# gdb -p pid

(gdb) p seteuid(userid)

share|improve this answer
This requires that pid is running as root already - calls run via p run in the context of the traced process. – MikeyB Feb 1 '10 at 18:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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