Open wilzbach opened 10 years ago
Same problem here, using Debian Wheezy with a debian kernel (upgraded) 3.10
Tried also with the default kernel, I got this:
~ ❯❯❯ reptyr 8453 1 [+] Allocated scratch page: b7723000 [+] Looking up fds for tty in child. [+] Resolved child tty: 880c [+] Found an alias for the tty: 0 [+] Found an alias for the tty: 1 [+] Found an alias for the tty: 2 [+] Opened the new tty in the child: 3 [+] Target is not a session leader, attempting to setsid. [+] Forked a child: 8592 [+] Change pgid for pid 8453 [+] Change pgid for pid 8579 [-] failed: Permission denied [-] Failed to setsid: Operation not permitted [+] Change pgid for pid 8453 [+] Change pgid for pid 8592 Unable to attach to pid 8453: Operation not permitted
Did you do this as mentioned in the documentation/readme?
echo 0 > /proc/sys/kernel/yama/ptrace_scope
yes, also tried as root
I had this problem with a pg_basebackup that I wanted to move to a screen session. I followed similar steps to those previously mentioned (suspend, background, disown, reptyr) and got "permission denied" exactly as mentioned by Thanatermesis.
Oddly, as root I was unable to assume control of the process, but as postgres, it worked. I hope that helps someone.
Note for others, even with ptrace_scope
set to 0
, the UID
s of both parent and child needs to be the same, thus if you try to reptyr
as root (or as a different UID
) a program running as your user, it will not let you.
echo 0 > /proc/sys/kernel/yama/ptrace_scope
donot work in a docker container
And Seems ptrace
and strace
not work due to security features
https://github.com/moby/moby/issues/20064
https://github.com/moby/moby/issues/21051
Running docker with
--security-opt="apparmor=unconfined" --cap-add=SYS_PTRACE
Commands I tried to far: a) echo "hi" ; sleep 200; echo "hi" b) ping "foo.com" c) irssi
Version: 0.5 on x64. Tested on zsh + bash.
Steps to reproduce
start a new terminal:
Unfortunately I get the following error: