I have ssh running on boot, on my raspberry PI, it works fine, until the screen shuts off, or it goes into a sleep mode, or whatever its doing. Then ssh becomes unresponsive, and I cannot establish new connections. How can I prevent the raspberry pi from going into sleep mode?
Your question isn't clear to me, but I guess you are asking about the ssh client instead of the ssh server/sshd.
If so, you may find help in reviewing the ssh client parameters in
There is no sleep mode in RPi.
If that doesn't help, please try to add details to your question that provide clues we can use.
It depends if you're running the pi with peripherals or if it's running headless. If you have peripherals connected to it - then it's not clear whether you are trying to ssh into other hosts, or if you are attempting to ssh into the pi from another client.
If it headless, the same lack of clarity does apply but it is more likely you are referring to using the pi as a host and attempting access with a client machine. If that is the case then anytime your client machine enters into a sleep state (or is shutdown for that matter), the ssh session is ultimately resolved with a 'broken pipe'.
The length of time before the connection is severed is based on your ssh_config file (or sshd_config for server side settings) and particularly the
AliveCountMax (this determines the amount of time that can pass before the connection is closed). Since your machine is in sleep mode, it is not sending any of the null packets that would be sent (based on the