SSH disconnects when waking up from sleep

larynx

macrumors newbie
Original poster
Oct 3, 2014
5
0
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
 

Phil A.

Moderator
Staff member
Apr 2, 2006
5,499
2,280
Shropshire, UK
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
 

mfram

macrumors 65816
Jan 23, 2010
1,056
138
San Diego, CA USA
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.
 

larynx

macrumors newbie
Original poster
Oct 3, 2014
5
0
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
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.



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.
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.
 

Phil A.

Moderator
Staff member
Apr 2, 2006
5,499
2,280
Shropshire, UK
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.
Wake for network access means respond to a WOL (wake on lan) request, not keep network connections open when the machine goes to sleep