You are not logged in.

#1 2019-12-17 09:45:14

oscarbranson
Member
Registered: 2017-09-28
Posts: 13

Prevent system sleep when ssh login is active

I routinely use wakeonlan to wake up a remote machine (from S3), ssh into it, then put the computer back to sleep when I'm done.

Irritatingly, the remote doesn't seem to recognise my ssh session as activity, and often goes back to sleep mid-way through. What is the correct way to prevent this? I can't find anything obvious on the Wiki under either ssh or power management.

The remote is running Gnome 3.3.42 with kernel 5.4.3. Both are using openssh.

Thanks in advance, and apologies if this belongs in Newbie Corner!

Offline

#2 2019-12-20 02:07:52

glitsj16
Member
Registered: 2015-04-26
Posts: 116

Re: Prevent system sleep when ssh login is active

You could try wrapping your ssh command with either a gnome-session-inhibit or a systemd-inhibit command. Have a look at the man pages for each of those to determine correct syntax etcetera.

Offline

Board footer

Powered by FluxBB