Auto-record on login
Record every interactive login automatically with the optional profile.d hook - fail-open, nested-shell aware, one file to remove.
The package installs a profile.d hook that records every interactive login and logs out when the recorded shell exits. Nothing else to configure — users just log in and work.
To enable it manually (for example after a static-binary install):
sudo install -m644 scripts/profile.d/ghostshell-autorec.sh /etc/profile.d/ghostshell-autorec.shBehavior
- Triggers only for interactive shells with a real TTY, and skips entirely when
ghostshellis absent. - Skips nested shells (
sudo su -,su -, subshells) two ways: an exportedGHOSTSHELL_REC=1marker the hook sets before recording (inherited by child shells, robust against process-name spoofing) and, as a fallback, detecting aghostshellprocess in the ancestry. - Fail-open: if the recorder cannot start for any reason, a normal shell continues. A login is never blocked.
Disable
Remove the file:
sudo rm /etc/profile.d/ghostshell-autorec.shScope
The login hook records interactive sessions only. A non-interactive SSH command (ssh host "cmd") never sources profile.d, so it is not captured by this hook — for that, enable the opt-in sshd ForceCommand wrapper.
Warning: The hook is deliberately fail-open and can be sidestepped by a determined user with shell access. That is a design decision, not an accident: availability is prioritized over guaranteed capture. Read the integrity caveat before treating auto-record as an enforcement mechanism.
Related
- SSH recording — capture non-interactive SSH commands too
- Quick start — recording on demand with
ghostshell rec