SSH disconnects when waking up from sleep

Discussion in 'macOS' started by larynx, Nov 9, 2015.

  1. larynx macrumors newbie

    Joined:
    Oct 3, 2014
    #1
    I'm using El Capitan 10.11.1, everytime I wake up my computer from sleep my SSH connection disconnects with a message showing in the terminal
    Code:
    Write failed: Broken pipe
    A message also appears in the System Log inside Console saying
    Code:
    11/6/15 4:02:36.559 PM configd[51]: network changed: v4(en0-:192.168.1.70) DNS- Proxy-
    11/6/15 4:02:40.468 PM configd[51]: network changed: v4(en0+:192.168.1.70) DNS+ Proxy+ SMB
    I searched for a solution and tried several things already like adding parameters in ssh_config, signing in to iCloud, settings a manual IP address, having the HDD not going to sleep in the Energy Saver settings and none worked. The only workaround I've found that works is settings the Computer Sleep settings to Never in the Energy Sleep settings but that doesn't seem like a good in the long run.

    Does anyone have a solution for this issue?

    Thanks
     
  2. Phil A. Moderator

    Phil A.

    Staff Member

    Joined:
    Apr 2, 2006
    Location:
    Shropshire, UK
    #2
    It's not really an issue but rather by design - when your computer goes to sleep shuts down the network connection which will disconnect your SSH session
     
  3. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #3
    If you're concerned about your shell session on the remote host, then I recommend you look into using 'screen' which will allow you to disconnect and re-connect to a virtual terminal session.
     
  4. larynx thread starter macrumors newbie

    Joined:
    Oct 3, 2014
    #4
    This seems more like a bug, especially when there is an checkbox (that is checked by default) in the Energy Saver settings titled "Wake for network access" which doesn't seem to do exactly that.

    [​IMG]

    I'm aware of it, I use tmux but it still quite annoying to have to reconnect to 10+ sessions every time I wake up the computer.
     
  5. Phil A. Moderator

    Phil A.

    Staff Member

    Joined:
    Apr 2, 2006
    Location:
    Shropshire, UK
    #5
    Wake for network access means respond to a WOL (wake on lan) request, not keep network connections open when the machine goes to sleep
     

Share This Page