Get the latest tech news

Keeping SSH sessions alive with systemd-inhibit


Lets learn how to use systemd-inhibit to block systems idle states.

After the typical timeout around 30 mins the system goes to sleep which drops the session and forces me to send another wol and reconnect via ssh and then reattach to tmux. Since we aren’t hand jamming the command each time we want to inhibit the power policy, we can take advantage of some niceties the cli provides. After some consideration, I determined running the commands in an incorrect order or sequence after many sessions could leave you with trying to kill a PID that isn’t what you want.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of SSH

SSH

Photo of SSH sessions

SSH sessions

Photo of inhibit

inhibit

Related news:

News photo

All You Need Is SSH

News photo

Spiped – secure pipe for SSH, SMTP, etc.

News photo

Ch.at – A lightweight LLM chat service accessible through HTTP, SSH, DNS and API