简体   繁体   English

SSH 控制主设置

[英]SSH Control master setup

I'm using ssh Control Master setup to connect to remote machines and using ControlPersist 16h and ControlPath ~/.ssh/master-%C options.我正在使用 ssh Control Master 设置连接到远程机器并使用ControlPersist 16hControlPath ~/.ssh/master-%C选项。 It seems to work fine.它似乎工作正常。 But when my Mac goes to sleep, it deletes the sockets created above.但是当我的 Mac 进入睡眠状态时,它会删除上面创建的 sockets。 Then I'm forced to enter password again on login to this remote machine.然后我在登录到这台远程机器时被迫再次输入密码。 Any suggestion, how one can get around this problem?任何建议,如何解决这个问题?

Considerind a ControlPersist directive would not persist your computer sleeping, you would need another alternative in order to get what you want.考虑到ControlPersist指令不会使您的计算机保持睡眠状态,您需要另一种选择才能获得所需的内容。

Namely, Mosh (mobile shell) (also on GitHub ):即, Mosh (移动外壳) (也在GitHub 上):

Mosh is a replacement for interactive SSH terminals. Mosh 是交互式 SSH 终端的替代品。 It's more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.它更加强大和响应迅速,尤其是在 Wi-Fi、蜂窝和长距离链路上。

It does persists connections when your computer sleeps.当您的计算机睡眠时,它确实会保持连接。

With Mosh, you can put your laptop to sleep and wake it up later, keeping your connection intact.使用 Mosh,您可以让您的笔记本电脑进入睡眠状态并稍后将其唤醒,从而保持您的连接完好无损。 If your Internet connection drops, Mosh will warn you — but the connection resumes when network service comes back.如果您的 Internet 连接中断,Mosh 会警告您 — 但当网络服务恢复时连接会恢复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM