r/linuxadmin • • 1h ago

Come evitare l'installazione accidentale di pacchetti sul server

Thumbnail reddit.com
0 Upvotes

r/linuxadmin • • 18h ago

SSHole is in KEV now, how are you finding musl/Alpine sshd across your environment?

7 Upvotes

In case anyone missed it, the OpenSSH password bypass people are calling SSHole got added to CISA’s KEV list this week. It only affects musl-based systems with PAM off and password auth on, so mostly Alpine, plus OpenWrt and some Yocto/Buildroot builds. Glibc distros are fine. There’s a fixed release and distro backports, and turning Password Authentication off is a decent stopgap once you’ve checked key login still works. Hunting for it isn’t too bad. Look for password logins on accounts that should never take one, new authorized_keys, weird files in /opt or init.d. Finding everything that’s in scope is the harder bit for me. For VMs I’m going off Tenable results, and the axonius pilot we have running puts the OS and openssh version from Tenable and the EDR on each host. I’m a lot less sure about container base images and CI runners, nothing we’ve connected to it reports those. How are you inventorying this? Are people actually finding openssh-server without PAM on production Alpine or OpenWrt, or is it mostly lab, CI and cloud images?


r/linuxadmin • • 2h ago

Memory admission, disk cleanup and sleep for a shared build host: lessons from running coding agents on spare machines

1 Upvotes

I run a small open source tool, boxd, that sends builds from coding agents to spare Linux machines (rootless Podman containers or small virtual machines, one per git worktree). Three host-side mechanisms, and what I got wrong first.

Admission by memory

  • All boxes live in one control group with memory.max and memory.swap.max (defaults 85 and 25 percent of host memory), plus per-box limits.
  • A new machine is admitted only if measured use plus its size fits the cap, and the sizes of running machines plus its size fit the cap too. Measuring alone fails: a young machine has not claimed its memory yet, so twelve 4 GB machines once got in on a 28 GB cap.
  • Otherwise: exit 75 and a message with the numbers, for example no room for another virtual machine (12288 MB of running machines + 4096 MB used by container boxes + 12288 MB asked > 24576 MB, 100% of the 24576 MB cap); wait for one to end or stop one. With --wait the client asks every 30 seconds and callers are served in the order they first asked. Without it, the client tries the next host.
  • Lesson: swap on zram is RAM. My count missed swapped memory. A group read 23713 MB with 7.7 GB more in swap and kept admitting machines until the kernel killed an 8 GB one. Now memory.swap.current is added, and half the swap the group may use on zram comes off the default cap.
  • Each machine records its real peak need, and removal says so: it needed 2900 MB of its 8192 MB at most.

The work area and its cleanup

  • It is its own btrfs subvolume, so system snapshots do not keep build data.
  • Whole box folders go, never single files: unused for BOXD_KEEP_DAYS (14), then the least recently used one per pass once the disk passes BOXD_EVICT_AT (70 percent) until it is under BOXD_EVICT_TO (60). The folder of a deleted worktree goes when the client next notices.
  • On a disk shared with the system, setup picks lower levels: current fill plus 20 points (at most 70), 10 below that, and 3 days.
  • Lesson: never judge a cache file's age by modification time. Package tools keep the upstream's old times on unpacked files, so one release deleted live cargo, Maven and npm cache files.
  • boxd-reset swaps in a clean subvolume in seconds. It refuses while anyone has an ssh session or holds boxd-keepawake.

A host that sleeps

The optional power module (boxd-idle) suspends after 20 quiet minutes: no ssh connections, load under 0.5, no boxd-keepawake lock. Before sleeping it arms wake on network and, if the disk is at BOXD_RESET_AT (85) percent, runs boxd-reset. The client sends a wake packet before each ssh; the wait is about 15 seconds.

Honest notes

All code was written by Claude Code, an AI coding agent, with me directing and testing on real hosts. It has been public for a few days. Host packages exist for Void Linux and Debian 13 only. MIT license: https://github.com/gsalucci/boxd

How do you handle memory admission on a host with zram swap, and what cleanup budget do you give build data on a disk shared with the system?