I can not directly access the target host, I need ssh as a proxy.
How can I kill a process from local use of ssh? I try this:
ssh root@$center "ssh root@$ip \"ps -ef|grep -v grep|grep $target_dir/$main|awk '{print \$2}'|xargs kill\""
he got an error:
kill: can't find process "root"
And how to avoid an error when the process does not exist?
source
share