【问题标题】:"client_loop: send disconnect: Broken pipe" while running long experiments with bash script\"client_loop: send disconnect: Broken pipe\" while running long experiments with bash 脚本
【发布时间】:2023-01-23 06:37:21
【问题描述】:

我通过 ssh 连接到 linux 虚拟机以运行长时间的实验(每个程序 3 小时)以进行学术研究。当我的电脑不使用时,我收到错误消息:client_loop: send disconnect: Broken pipe。我看过这个论坛并尝试了许多解决方案,例如:

  1. 在我的~/.ssh中创建一个文件config(同时使用sudo chmod 644 ~/.ssh/config创建)并添加以下行:
    ServerAliveInterval 60
    ServerAliveCountMax 100000
    
    1. /etc/ssh/ssh_config我添加了以下内容:
    Host*
        ServerAliveInterval 60
        ServerAliveCountMax 100000
    
    1. 最后/etc/ssh/sshd_config我添加了以下内容:
    TCPKeepAlive yes
    ClientAliveInterval 60
    ClientAliveCountMax 100000
    

    我有我所有的 macbook 设置,通过使用以下命令 sudo pmset -a disablesleep 1 并更改所有省电方法,它不会进入睡眠状态。

    但是,在离开计算机约 1 小时而不主动使用它时(因此屏幕保护程序在屏幕上),我收到此消息。

    我真的不知道从哪里看这一点。我唯一可以考虑的是 MaxStartups 10:30:100 中的 /etc/ssh/sshd_configConnectTimeout 0 中的 /etc/ssh/ssh_config,但我不完全确定更改这些的影响是什么。

    任何解决此问题的建议将不胜感激!

    谢谢!

    编辑/更新:我注意到当我让我的电脑过夜但我没有运行 bash 脚本时,我没有收到 broken pipe 错误。

    编辑/更新 2:我发现我可以让我的计算机无人看管至少 30 分钟而不会出现管道损坏错误

【问题讨论】:

  • 备查。我的论文导师提出了一个解决方案。我已经在我的 Linux 服务器上安装了screen,它似乎可以工作。

标签: ssh virtual-machine broken-pipe


【解决方案1】:

我通过在我的 macbook /etc/ssh/ssh_config 中添加以下内容来解决

Host *
   ServerAliveInterval 60 #add this line

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-30
    • 1970-01-01
    • 2020-05-24
    • 1970-01-01
    • 2020-01-24
    • 1970-01-01
    • 2016-10-03
    • 1970-01-01
    相关资源
    最近更新 更多