---
name: "pam_open_session"
section: "3"
platform: "linux"
package: "pam"
version: "1.7.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/pam_open_session"
---

# pam\_open\_session(3)

start PAM session management

## NAME

pam\_open\_session - start PAM session management

## SYNOPSIS

```
#include <security/pam_appl.h>
```

**int pam\_open\_session(pam\_handle\_t \****pamh***, int** *flags***);**

## DESCRIPTION

The **pam\_open\_session** function sets up a user session for a previously successfully authenticated user. The session should later be terminated with a call to [**pam\_close\_session**(3)](/pam_close_session/3.md).

It should be noted that the effective uid, [**geteuid**(2)](/geteuid/2.md), of the application should be of sufficient privilege to perform such tasks as creating or mounting the user's home directory for example.

The flags argument is the binary or of zero or more of the following values:

PAM\_SILENT

Do not emit any messages.

## RETURN VALUES

PAM\_ABORT

General failure.

PAM\_BUF\_ERR

Memory buffer error.

PAM\_SESSION\_ERR

Session failure.

PAM\_SUCCESS

Session was successfully created.

## SEE ALSO

[**pam\_close\_session**(3)](/pam_close_session/3.md), [**pam\_strerror**(3)](/pam_strerror/3.md)
