Login via SSH && suspend

An active login via SSH into the L5 (via Wifi or USB tethering) should suspend the automatic suspend, IMHO.


You can make it happen if you want. Not sure if documented in the purism wiki but it is documented in the mobian wiki:



If that approach is used, does the inhibit of suspend end automatically when the ssh session ends, or should one be looking to reverse the inhibit (how is that done?) in e.g. .bash_logout ?

Slightly unrelated. mosh (Mobile Shell) is ssh over udp and can deal with temporary disconnects caused by things like suspend or change of network.

1 Like

The suspend inhibition will end when logging out of the ssh session

1 Like

A problem is when the Wifi disappears for the L5, because you move away with it from the Wifi zone, the SSH session and the inhibit stay for long time.

You can set keepalive intervals and connection timeouts in sshd config.

1 Like

I created this file and restarted the sshd:

purism@pureos:~$ cat /etc/ssh/sshd_config.d/add.conf
# terminate the session if SSH client does not answer 3 times
# sshd does the check in intervals of 15 secs;
# credits: https://forums.puri.sm/t/login-via-ssh-suspend/20107/7
ClientAliveInterval 15
ClientAliveCountMax 3

purism@pureos:~$ sudo systemctl restart sshd

Sometimes SSH sessions and its process survive. I have to investigate, why:

purism@pureos:~$ ps ax | grep inhi
  51430 ?        Sl     0:00 gnome-session-inhibit --inhibit suspend --reason SSH connection active --inhibit-only
  65112 pts/1    Sl     0:00 gnome-session-inhibit --inhibit suspend --reason SSH connection active --inhibit-only

My config looks like this:

  • disabled ssh.service and enabled ssh.socket
  • created ssh-no-sleep@.service
Description=ssh no sleep

ExecStart=/usr/bin/gnome-session-inhibit --inhibit suspend --inhibit-only --app-id ssh --reason "ssh session "%I

  • added an override for ssh@.service:
  • added these to sshd config:
ClientAliveInterval 60
ClientAliveCountMax 5

So far I’ve been happy with it.