The follow command works in a local terminal:
ps aux | grep "script.py" | awk {'print $2'} | xargs kill -2
But this command doesn't work remotely:
ssh -o ConnectTimeout=6 john@remote-pc ps aux | grep "script.py" | awk {'print $2'} | xargs kill -2
...even though script.py on remote belongs to john, the user we are ssh as. I can ping successfully and other commands are successful.