gpt4 book ai didi

linux - 通过 ssh 杀死远程进程

转载 作者:IT王子 更新时间:2023-10-29 00:38:50 25 4
gpt4 key购买 nike

<分区>

我不能直接访问目标主机,需要ssh作为代理。

如何从本地使用 ssh 终止进程?我试试这个:

ssh root@$center "ssh root@$ip \"ps -ef|grep -v grep|grep $target_dir/$main|awk '{print \$2}'|xargs kill\""

出现错误:

kill: can't find process "root"

以及如何在进程不存在的情况下避免错误?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com