mac 终端怎么断开ssh_如何在Mac OS X的终端中从SSH断开连接

mac 终端怎么断开ssh_如何在Mac OS X的终端中从SSH断开连接

mac 终端怎么断开ssh

mac 终端怎么断开ssh_如何在Mac OS X的终端中从SSH断开连接

Ever since switching to OS X there has been one tiny annoyance bugging me, and it really is a small one: My SSH sessions will hang whenever my v*n times out, and then I have to close out of the Terminal to get it to disconnect, because SSH takes forever to time out for some reason.

自从切换到OS X以来,一直困扰着我一个小小的烦恼,这确实是一个小麻烦:每当我的v*n超时时,我的SSH会话都会挂起,然后我必须关闭终端以使其断开连接,因为某些原因,SSH会永远超时。

Of course, there are a bunch of settings that you can use to change the SSH timeout so it’ll recognize that the connection is gone, but I was in the mood for instant gratification. Luckily there is an easy shortcut key sequence you can use to make SSH disconnect instantly.

当然,您可以使用许多设置来更改SSH超时,以便它可以识别连接已消失,但是我很想立即获得满足。 幸运的是,您可以使用简单的快捷键序列使SSH立即断开连接。

输入〜。 (Enter ~ .)

That’s the Enter key, then the Tilde (~) key, followed by the period key (.), although I was able to also just use the tilde followed by period when using a drop-down terminal. In any case, it disconnects me instantly on OS X Mavericks, and that’s good enough for me.

那是Enter键,然后是Tilde(〜)键,然后是句点键(。),尽管在使用下拉终端时我也可以只使用波浪号和句点。 无论如何,它立即使我在OS X Mavericks上断开连接,这对我来说已经足够了。

mac 终端怎么断开ssh_如何在Mac OS X的终端中从SSH断开连接

I’m sure that I’ll be using this shortcut key sequence every day, so I won’t forget it, but maybe it’ll help somebody else. And for those that are wondering, CTRL + D just wasn’t working for me.

我确定我每天都会使用此快捷键序列,因此我不会忘记它,但是也许会对其他人有所帮助。 对于那些想知道的人,CTRL + D并没有为我工作。

翻译自: https://www.howtogeek.com/178798/how-to-disconnect-from-ssh-in-a-terminal-on-mac-os-x/

mac 终端怎么断开ssh