SHELL-TIMEOUT.CON(5)
π shell-timeout.conf β hey bestie, let's talk timeouts π
okay so this is the manual for shell-timeout.conf, the config file behind the shell-timeout inactivity scripts. it's genuinely not scary, i promise β it's just a bunch of KEY=VALUE lines and then your shell gets a nap timer. slay.
β¨ SYNOPSIS β¨
/etc/default/shell-timeout
/etc/default/shell-timeout.d/*.conf
like yeah that's it, those are the two places it lives. one main file, one drop-in folder. iconic behavior honestly.
π DESCRIPTION π
shell-timeout.conf is the configuration file for the shell-timeout.sh(7) script (that's the bash/zsh one) and the shell-timeout.csh(7) script (the csh/tcsh one). what these scripts do is: whenever the current user matches a configured UID, GID, username, or group name, they automatically set an inactivity timeout for interactive shells. so if you walk away from your terminal forever, it logs you out. self-care fr fr π
the main configuration file is /etc/default/shell-timeout. you can also drop additional files into /etc/default/shell-timeout.d/*.conf. those drop-ins get processed in alphabetical order after the main file. and here's the cute part: values from later files extend the lists from earlier ones, they don't replace them. so a drop-in can add or remove entries without you having to rewrite the whole base config. no cap, that's the whole design goal.
πΈ FILE FORMAT πΈ
these config files use a shell-neutral KEY=VALUE format. rules go like this:
- One key-value pair per line.
- Keys and values are separated by a single
=with no surrounding spaces. - Values may be optionally quoted with single or double quotes.
- Multiple space-separated items may appear in a single value field.
- Lines beginning with
#are comments and are ignored. - Empty lines are ignored.
Example.
# Timeout all users who are members of the "staff" group
TMOUT_SECONDS=900
TMOUT_GROUPS=staff
TMOUT_READONLY=yes
see? adorable. tiny. does its job.
π CONFIGURATION VARIABLES π
β° Timeout duration
TMOUT_SECONDS= integer β the inactivity timeout, in seconds. it has to be a positive integer greater than zero. non-integer, zero, negative, and empty values all cause the scripts to exit without setting any timeout (so like, nothing happens, no protection, just vibes). in csh and tcsh the value gets converted to minutes (rounded down, minimum 1 minute). don't ask, that's just how those shells live.
π Readonly enforcement
TMOUT_READONLY=yes|true|1|no|false|0β when it's set toyes,true, or1, the timeout variable gets made read-only after being set, which stops users from disabling it. exactly the energy we want π₯. this option is silently ignored in csh and tcsh, because those shells don't support read-only shell variables at all. not their fault.
π Matching by numeric UID or GID
TMOUT_UIDS= uid [uid ...] β space-separated list of numeric user IDs. any user whose effective UID shows up in this list gets the timeout set. values from multiple configuration files are merged together.TMOUT_GIDS= gid [gid ...] β space-separated list of numeric group IDs. any user whose primary or supplementary GID shows up in this list gets the timeout set. values from multiple configuration files are merged together.
π§ Matching by username or group name
TMOUT_USERNAMES= name [name ...] β space-separated list of usernames. each name gets resolved to a numeric UID at runtime viaid(1). names that can't be resolved are silently ignored (no drama, no error). the resolved UIDs are merged intoTMOUT_UIDSbefore matching.TMOUT_GROUPS= name [name ...] β space-separated list of group names. each name gets resolved to a numeric GID at runtime viagetent(1). names that can't be resolved are silently ignored. the resolved GIDs are merged intoTMOUT_GIDSbefore matching.
π Removing entries from consideration (numeric)
TMOUT_UIDS_NOCHECK= uid [uid ...] β space-separated list of numeric UIDs to remove fromTMOUT_UIDS. a user whose UID gets removed from the UID list won't match via the UID path anymore β but heads up, they might still match via the GID path if their group is configured. πTMOUT_GIDS_NOCHECK= gid [gid ...] β space-separated list of numeric GIDs to remove fromTMOUT_GIDS. a GID removed from the GID list won't cause a match via the GID path, but users whose UIDs are still inTMOUT_UIDSwill keep matching. sneakyyyy.
π«Ά Removing entries from consideration (by name)
TMOUT_USERNAMES_NOCHECK= name [name ...] β space-separated list of usernames to remove from consideration. each name gets resolved to a numeric UID at runtime and merged intoTMOUT_UIDS_NOCHECK. numeric IDs and names can be freely mixed across files, so go off.TMOUT_GROUPS_NOCHECK= name [name ...] β space-separated list of group names to remove from consideration. each name gets resolved to a numeric GID at runtime and merged intoTMOUT_GIDS_NOCHECK. numeric IDs and names may be freely mixed across files.
π¦ Readonly exemptions (numeric)
TMOUT_UIDS_NOREADONLY= uid [uid ...] β space-separated list of numeric UIDs that are exempt from readonly enforcement. whenTMOUT_READONLYis set, a user whose UID is in this list still getsTMOUTset toTMOUT_SECONDS, it just won't be made readonly. this option is silently ignored in csh and tcsh.TMOUT_GIDS_NOREADONLY= gid [gid ...] β space-separated list of numeric GIDs exempt from readonly enforcement. a user whose primary or supplementary GID is in this list getsTMOUTset but not locked. this option is silently ignored in csh and tcsh.
π Readonly exemptions (by name)
TMOUT_USERNAMES_NOREADONLY= name [name ...] β space-separated list of usernames exempt from readonly enforcement. each name gets resolved to a numeric UID at runtime and merged intoTMOUT_UIDS_NOREADONLY.TMOUT_GROUPS_NOREADONLY= name [name ...] β space-separated list of group names exempt from readonly enforcement. each name gets resolved to a numeric GID at runtime and merged intoTMOUT_GIDS_NOREADONLY.
π MATCHING SEMANTICS π
the UID and GID matching paths are fully independent. like, they don't talk to each other at all.
removing an entry from the UID list (via TMOUT_UIDS_NOCHECK or TMOUT_USERNAMES_NOCHECK) has zero effect on GID matching, and vice versa. so a user whose UID has been explicitly excluded can still get the timeout applied, because one of their groups is listed in TMOUT_GIDS. plot twist, i know π
name resolution happens before list subtraction. the effective evaluation order is:
- Accumulate all
TMOUT_UIDSandTMOUT_USERNAMESvalues from all configuration files (main + drop-ins). - Resolve each username to its numeric UID.
- Accumulate all
TMOUT_UIDS_NOCHECKandTMOUT_USERNAMES_NOCHECKvalues and resolve usernames to UIDs. - Subtract the NOCHECK UIDs from the UID list.
- Repeat steps 1-4 for GIDs and group names.
- Compare the current user's UID and all their GIDs against the final lists.
- If a match is found, set
TMOUTtoTMOUT_SECONDS. - If
TMOUT_READONLYis set, check whether the user's UID is inTMOUT_UIDS_NOREADONLY(after resolvingTMOUT_USERNAMES_NOREADONLY) or any of their GIDs is inTMOUT_GIDS_NOREADONLY(after resolvingTMOUT_GROUPS_NOREADONLY). if exempt,TMOUTis left writable; otherwise it gets made readonly.
that's the whole pipeline. read it twice, it's giving algorithm π
β EXAMPLES β
πΈ Timeout all members of a group, exempt one user
/etc/default/shell-timeout:
TMOUT_SECONDS=900
TMOUT_GROUPS=employees
TMOUT_READONLY=yes
/etc/default/shell-timeout.d/exceptions.conf:
# Service account does not need a timeout
TMOUT_USERNAMES_NOCHECK=svcaccount
πΈ Mix numeric IDs and names
TMOUT_SECONDS=600
TMOUT_UIDS=1042
TMOUT_USERNAMES=alice bob
TMOUT_GIDS=500
TMOUT_GROUPS=contractors
πΈ Drop-in adds a group, removes one user from a different drop-in
/etc/default/shell-timeout.d/10-base.conf:
TMOUT_GROUPS=staff
/etc/default/shell-timeout.d/20-exceptions.conf:
# Remove a specific user added by an earlier drop-in
TMOUT_UIDS_NOCHECK=1099
πΈ Global readonly with per-user exemption
/etc/default/shell-timeout:
TMOUT_SECONDS=900
TMOUT_GROUPS=employees
TMOUT_READONLY=yes
/etc/default/shell-timeout.d/sysadmin-noreadonly.conf:
# Sysadmins can adjust or unset their own timeout
TMOUT_GROUPS_NOREADONLY=sysadmins
# A specific service account by name
TMOUT_USERNAMES_NOREADONLY=deploy-bot
π FILES π
/etc/default/shell-timeoutβ the main configuration file./etc/default/shell-timeout.d/*.confβ drop-in configuration files, processed in alphabetical order./etc/profile.d/shell-timeout.shβ the POSIX shell (bash/zsh) script, sourced at login./etc/profile.d/shell-timeout.cshβ the C shell (csh/tcsh) script, sourced at login.
π SEE ALSO π
id(1), getent(1), bash(1), zsh(1), csh(1), tcsh(1)
go read those if you want the lore. iykyk.
π NOTES π
the csh and tcsh interpreters do not support read-only variables, so TMOUT_READONLY has no effect in those shells. periodt. also, the inactivity timeout is implemented via the autologout shell variable, which is the number of minutes of idle time before logout (minimum 1). so like, one minute is the floor, don't try to be clever.
okay bestie that's the whole page π«Ά go set your TMOUT_SECONDS and stay safe out there. and remember: NOCHECK removes, NOREADONLY exempts, and they are not the same thing, don't @ me.
β¨ this has been SHELL-TIMEOUT.CON(5), from the 03/18/2026 edition β mwah, bye β¨
π¦ where this page comes from
- epel 10: shell-timeout 0.3.0-2.el10_3 Β· GPL-3.0-or-later
- epel 9: shell-timeout 0.3.0-2.el9 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms