frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Keeping SSH sessions alive with systemd-inhibit

https://kd8bny.com/posts/session_inhibit/
18•kd8bny•2d ago

Comments

blueflow•1h ago
Of course systemd killing your SSH session is a intentional feature, not a bug.

Consider disabling suspend from the logind.conf and suspend, if at all, only at explicit user request.

jon-wood•1h ago
I think the author’s point was that this is usually desired behaviour because it’s a desktop and only occasionally do they want to stop that.
jeroenhd•1h ago
systemd doesn't kill your SSH session (if you'd WoL your PC there's a good chance you can continue typing unless your local terminal detects that the other end goes down).

It's more that when you configure systemd to suspend your computer when there is no physical activity, it will suspend your computer when there is no physical activity.

The author wants their computer to suspend automatically.

I think modifying your system configuration to never suspend is a much worse solution than using the tool designed to prevent suspending the computer while a specific program is running to prevent suspending the computer while that specific program is running.

It'd be easier if `sshd` would permit you to wrap the incoming command line/shells so `sshd` would spawn your session with systemd-inhibit, but I don't think that's possible?

blueflow•47m ago
Unwarranted suspends by logind have always been a menace, i have been fighting them for a decade.

> It'd be easier if `sshd` would permit you to wrap the incoming command line/shells so `sshd` would spawn your session with systemd-inhibit, but I don't think that's possible?

sshd already links against systemd (by distro patches, not per upstream) but since SSH is a "legacy protocol" and its users are "uneducated troglodytes", this is not going to happen.

I think this is because OpenSSH is an OpenBSD project, and both systemd and OpenBSD refuse to support each other.

1oooqooq•58m ago
i think i used a laptop for a few hours in my life before I decided to simply disable all autosleep features.

computer is on, it's on. lid close, screen is off. done.

zokier•47m ago
I think this could be made into systemd (user) service fairly easily. Then you wouldn't need to worry about `disown` or tracking the PID, you'd just `systemctl --user start|stop prevent-sleep.service`

If you want to be extra fancy, you could even write small program that calls the dbus api directly and then just waits to be killed. Avoids the turducken of waiting processes.

1970-01-01•38m ago
Why not fix the keep alive time? Yes, there's no wrong way to do it, but IMHO the nix philosophy states you should at least try to stick your problem and your solution together.

https://www.golinuxcloud.com/keep-alive-ssh-sessions-in-linu...

https://en.wikipedia.org/wiki/Keepalive

JdeBP•2m ago
Yes, this is a bodge. And yes, it should be unnecessary to jam in an inhibitor lock taken around the lifetime of an interactive shell permanently in the background.

The author wants xyr system to not suspend when either there's someone active on the GUI or when xe is logged in over the network. Theoretically, systemd already has a whole mechanism for making this happen.

The pam_systemd.so hook into PAM allows systemd-logind to track SSH sessions in its replacement for the Unix login database — all of that stuff under /run/systemd/users/, /run/systemd/seats/, and /run/systemd/sessions/. And in theory systemd-logind could respond negatively to a suspend request if there is an active SSH login session even if the GUI is idle.

In practice, it does not quite have the logic for achieving this.

* https://github.com/systemd/systemd/blob/main/src/login/login...

* https://github.com/systemd/systemd/blob/main/src/login/login...

KDE is now my favorite desktop

https://kokada.dev/blog/kde-is-now-my-favorite-desktop/
60•todsacerdoti•1h ago•42 comments

Slack has raised our charges by $195k per year

https://skyfall.dev/posts/slack
1786•JustSkyfall•11h ago•793 comments

This Website Has No Class

https://aaadaaam.com/notes/no-class/
114•robin_reala•4h ago•45 comments

Midcentury North American Restaurant Placemats

https://casualarchivist.substack.com/p/order-up
22•NaOH•1d ago•4 comments

CERN Animal Shelter for Computer Mice

https://computer-animal-shelter.web.cern.ch/index.shtml
156•EbNar•6h ago•18 comments

You Had No Taste Before AI

https://matthewsanabria.dev/posts/you-had-no-taste-before-ai/
81•codeclimber•1h ago•73 comments

WASM 3.0 Completed

https://webassembly.org/news/2025-09-17-wasm-3.0/
951•todsacerdoti•19h ago•416 comments

Show HN: The text disappears when you screenshot it

https://unscreenshottable.vercel.app/?text=Hello
354•zikero•11h ago•119 comments

Meta Ray-Ban Display

https://www.meta.com/blog/meta-ray-ban-display-ai-glasses-connect-2025/
487•martpie•12h ago•708 comments

The quality of AI-assisted software depends on unit of work management

https://blog.nilenso.com/blog/2025/09/15/ai-unit-of-work/
4•mogambo1•17m ago•0 comments

Fast Fourier Transforms Part 1: Cooley-Tukey

https://connorboyle.io/2025/09/11/fft-cooley-tukey.html
30•signa11•3h ago•5 comments

Keeping SSH sessions alive with systemd-inhibit

https://kd8bny.com/posts/session_inhibit/
19•kd8bny•2d ago•8 comments

Pnpm has a new setting to stave off supply chain attacks

https://pnpm.io/blog/releases/10.16
88•ivanb•6h ago•70 comments

CircuitHub (YC W12) Is Hiring Operations Research Engineers (UK/Remote)

https://www.ycombinator.com/companies/circuithub/jobs/UM1QSjZ-operations-research-engineer
1•seddona•3h ago

Nvidia buys $5B in Intel stock in seismic deal

https://www.tomshardware.com/pc-components/cpus/nvidia-and-intel-announce-jointly-developed-intel...
150•stycznik•2h ago•97 comments

60 years after Gemini, newly processed images reveal details

https://arstechnica.com/space/2025/09/60-years-after-gemini-newly-processed-images-reveal-incredi...
23•rbanffy•2d ago•1 comments

One Token to rule them all – Obtaining Global Admin in every Entra ID tenant

https://dirkjanm.io/obtaining-global-admin-in-every-entra-id-tenant-with-actor-tokens/
249•colinprince•14h ago•37 comments

Orange Pi RV2 $40 RISC-V SBC: Friendly Gateway to IoT and AI Projects

https://riscv.org/ecosystem-news/2025/09/orange-pi-rv2-40-risc-v-sbc-friendly-gateway-to-iot-and-...
70•warrenm•2d ago•64 comments

Boring is good

https://jenson.org/boring/
226•zdw•2d ago•54 comments

A postmortem of three recent issues

https://www.anthropic.com/engineering/a-postmortem-of-three-recent-issues
325•moatmoat•16h ago•104 comments

Nvidia to Invest $5B in Intel

https://www.ft.com/content/be8d4c0c-66ff-4dfd-9b43-af6c0b290ada
36•mmarian•1h ago•7 comments

John Grisham Still Wonders: Will Texas Kill Robert Roberson?

https://www.dmagazine.com/frontburner/2025/09/author-john-grisham-still-wonders-will-texas-kill-r...
19•rossant•5h ago•0 comments

YouTube addresses lower view counts which seem to be caused by ad blockers

https://9to5google.com/2025/09/16/youtube-lower-view-counts-ad-blockers/
388•iamflimflam1•22h ago•706 comments

Hypervisor 101 in Rust

https://tandasat.github.io/Hypervisor-101-in-Rust/
138•pykello•12h ago•10 comments

History of the Gem Desktop Environment

https://nemanjatrifunovic.substack.com/p/history-of-the-gem-desktop-environment
45•ibobev•6h ago•20 comments

Ton Roosendaal to step down as Blender chairman and CEO

https://www.cgchannel.com/2025/09/ton-roosendaal-to-step-down-as-blender-chairman-and-ceo/
348•cma•20h ago•69 comments

Stepping Down as Libxml2 Maintainer

https://discourse.gnome.org/t/stepping-down-as-libxml2-maintainer/31398
128•zdw•13h ago•67 comments

Elements of C Style (1994)

https://www.teamten.com/lawrence/style/
24•signa11•2d ago•2 comments

Towards a Physics Foundation Model

https://arxiv.org/abs/2509.13805
84•NeoInHacker•10h ago•17 comments

A QBasic Text Adventure Still Expanding in 2025

https://the-ventureweaver.itch.io/
67•ATiredGoat•10h ago•27 comments