---
name: "pam_session_timelimit"
section: "8"
platform: "linux"
package: "pam-session-timelimit"
version: "0.7-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pam_session_timelimit"
---

# pam\_session\_timelimit(8)

Module to impose daily time limits on user sessions

## NAME

pam\_session\_timelimit - Module to impose daily time limits on user sessions

## SYNOPSIS

**pam\_session\_timelimit.so** \[...\]

## DESCRIPTION

The pam\_session\_timelimit PAM module interfaces with systemd to limit the length of time that a user can use a service. This is a per-day time limit; each successive session counts against the limit and reduces the time available on a given day for remaining sessions.

The time used by a session is only recorded at the session end. It is therefore possible to exceed the absolute limit by launching sessions in parallel.

By default the settings for per-user session time limits are taken from the config file /etc/security/time\_limits.conf. An alternate file can be specified with the *path* option.

Time limits in this config file are expressed using the syntax described in [**systemd.time**(7)](/systemd.time/7.md).

The config file format does not support configuring different time limits for different services. To achieve this, use different *path* options for each service.

## OPTIONS

**path=/path/to/time\_limits.conf**

Indicate an alternative configuration file following the time\_limits.conf format to override the default.

**statepath=/path/to/session\_state**

Indicate an alternative state file where the module should record each user's used session time for the day.

## MODULE TYPES PROVIDED

The **account** and **session** module types are provided.

## RETURN VALUES

PAM\_SUCCESS

Access was granted.

PAM\_PERM\_DENIED

The user is not allowed access at this time.

PAM\_BUF\_ERR

Memory buffer error.

PAM\_SYSTEM\_ERR

An unexpected error was encountered.

PAM\_SESSION\_ERR

The session was not opened correctly and therefore cannot be closed correctly.

PAM\_BAD\_ITEM

The module could not identify the user to be given access.

PAM\_IGNORE

No session limit has been configured for this user.

## FILES

/etc/security/time\_limits.conf

Default configuration file

/var/lib/session\_times

Default state file

## EXAMPLES

```
#%PAM-1.0
#
# apply pam_session_timelimit accounting to login requests
#
login  account  required  pam_session_timelimit.so
login  session  required  pam_session_timelimit.so
```

## SEE ALSO

[**systemd.time**(7)](/systemd.time/7.md), [**pam.d**(5)](/pam.d/5.md), [**pam**(7)](/pam/7.md).

## AUTHOR

pam\_session\_timelimit was written by Steve Langasek \<vorlon@dodds.net\>.
