空闲终端安全字符

Kat*_*oak 7 linux vim ssh terminal

我在 Mac 上使用 iTerm2 来做 Linux 工作。为了避免丢失终端连接,我打开了“空闲时,发送 Ascii 代码”。默认值为 0。这就像一个保持连接活跃的魅力,但有一个严重的问题。

事实证明这是将 ^@ 发送到终端,这在大多数情况下是可以的,但vi它会插入最近输入的文本。

我能寄什么东西是安全的?

slm*_*slm 9

您可以不使用此ssh选项来防止连接断开吗?

在你的 ~/.ssh/config 文件中试试这个选项:

ServerAliveInterval=15
Run Code Online (Sandbox Code Playgroud)

摘自 man ssh_config

ServerAliveInterval
      Sets a timeout interval in seconds after which if no data has been 
      received from the server, ssh(1) will send a message through the encrypted
      channel to request a response from the server.  The default is 0, 
      indicating that these messages will not be sent to the server.  This 
      option applies to protocol version 2 only.
Run Code Online (Sandbox Code Playgroud)

您可以使用以下开关从命令行临时执行此操作ssh

$ ssh -o ServerAliveInterval=15 keepsdroppingme.com
Run Code Online (Sandbox Code Playgroud)

目录的权限~/.ssh/可能有点麻烦,如果您需要任何其他指导,请参阅这篇文章:防止您的 SSH 连接冻结