jackhab Asked: 2009-10-19 03:46:15 +0800 CST2009-10-19 03:46:15 +0800 CST 2009-10-19 03:46:15 +0800 CST Change EUID of running process 772 On Linux how can I change EUID of running process from command line (provided I have root access)? Thanks linux 3 Answers Voted Best Answer Kyle Brandt 2009-10-19T06:54:22+08:002009-10-19T06:54:22+08:00 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. Zanchey 2009-10-19T07:16:09+08:002009-10-19T07:16:09+08:00 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. sfink 2010-02-02T10:41:14+08:002010-02-02T10:41:14+08:00 Use gdb. # gdb -p pid (gdb) p seteuid(userid)
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.
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.
Use gdb.
# gdb -p pid
(gdb) p seteuid(userid)