1

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

Thanks

jackhab
  • 771
  • 1
  • 8
  • 21

3 Answers3

1

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.

Kyle Brandt
  • 83,619
  • 74
  • 305
  • 448
0

Use gdb.

# gdb -p pid

(gdb) p seteuid(userid)

sfink
  • 215
  • 3
  • 10
  • 1
    This requires that _pid_ is running as root already - calls run via `p` run in the context of the traced process. – MikeyB Feb 01 '10 at 18:56
0

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.

Zanchey
  • 3,051
  • 22
  • 28