如何断开ssh连接

上网、浏览、聊天、下载等
头像
link307
帖子: 98
注册时间: 2011-06-13 19:29

Re: 如何断开ssh连接

#16

帖子 link307 » 2011-08-20 20:52

bigsun 写了:killall ssh

或者
#!/bin/bash
#Find the PID of the ssh tunnel in the background and assign it to a variable
PID=$(ps -eo pid,args | grep 'ssh -qTfnN -i /path/id_rsa -D 7070 acount@server' | grep -v 'grep' | cut -c1-6)

#kill the tunnel
kill -9 $PID
其中'ssh -qTfnN -i /path/id_rsa -D 7070 acount@server'照抄起动时的命令.
有没有什么办法可以"正常地"重新获得对它的管理。(虽然可以ssh -D 7070 account@server 之后提示已经登录然后重新登录。)
回复