Blame modules/pam_xauth/pam_xauth.8

Packit 7e982e
'\" t
Packit 7e982e
.\"     Title: pam_xauth
Packit 7e982e
.\"    Author: [see the "AUTHOR" section]
Packit 7e982e
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
Packit 7e982e
.\"      Date: 05/18/2017
Packit 7e982e
.\"    Manual: Linux-PAM Manual
Packit 7e982e
.\"    Source: Linux-PAM Manual
Packit 7e982e
.\"  Language: English
Packit 7e982e
.\"
Packit 7e982e
.TH "PAM_XAUTH" "8" "05/18/2017" "Linux-PAM Manual" "Linux\-PAM Manual"
Packit 7e982e
.\" -----------------------------------------------------------------
Packit 7e982e
.\" * Define some portability stuff
Packit 7e982e
.\" -----------------------------------------------------------------
Packit 7e982e
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit 7e982e
.\" http://bugs.debian.org/507673
Packit 7e982e
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
Packit 7e982e
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit 7e982e
.ie \n(.g .ds Aq \(aq
Packit 7e982e
.el       .ds Aq '
Packit 7e982e
.\" -----------------------------------------------------------------
Packit 7e982e
.\" * set default formatting
Packit 7e982e
.\" -----------------------------------------------------------------
Packit 7e982e
.\" disable hyphenation
Packit 7e982e
.nh
Packit 7e982e
.\" disable justification (adjust text to left margin only)
Packit 7e982e
.ad l
Packit 7e982e
.\" -----------------------------------------------------------------
Packit 7e982e
.\" * MAIN CONTENT STARTS HERE *
Packit 7e982e
.\" -----------------------------------------------------------------
Packit 7e982e
.SH "NAME"
Packit 7e982e
pam_xauth \- PAM module to forward xauth keys between users
Packit 7e982e
.SH "SYNOPSIS"
Packit 7e982e
.HP \w'\fBpam_xauth\&.so\fR\ 'u
Packit 7e982e
\fBpam_xauth\&.so\fR [debug] [xauthpath=\fI/path/to/xauth\fR] [systemuser=\fIUID\fR] [targetuser=\fIUID\fR]
Packit 7e982e
.SH "DESCRIPTION"
Packit 7e982e
.PP
Packit 7e982e
The pam_xauth PAM module is designed to forward xauth keys (sometimes referred to as "cookies") between users\&.
Packit 7e982e
.PP
Packit 7e982e
Without pam_xauth, when xauth is enabled and a user uses the
Packit 7e982e
\fBsu\fR(1)
Packit 7e982e
command to assume another user\*(Aqs privileges, that user is no longer able to access the original user\*(Aqs X display because the new user does not have the key needed to access the display\&. pam_xauth solves the problem by forwarding the key from the user running su (the source user) to the user whose identity the source user is assuming (the target user) when the session is created, and destroying the key when the session is torn down\&.
Packit 7e982e
.PP
Packit 7e982e
This means, for example, that when you run
Packit 7e982e
\fBsu\fR(1)
Packit 7e982e
from an xterm session, you will be able to run X programs without explicitly dealing with the
Packit 7e982e
\fBxauth\fR(1)
Packit 7e982e
xauth command or ~/\&.Xauthority files\&.
Packit 7e982e
.PP
Packit 7e982e
pam_xauth will only forward keys if xauth can list a key connected to the $DISPLAY environment variable\&.
Packit 7e982e
.PP
Packit 7e982e
Primitive access control is provided by
Packit 7e982e
~/\&.xauth/export
Packit 7e982e
in the invoking user\*(Aqs home directory and
Packit 7e982e
~/\&.xauth/import
Packit 7e982e
in the target user\*(Aqs home directory\&.
Packit 7e982e
.PP
Packit 7e982e
If a user has a
Packit 7e982e
~/\&.xauth/import
Packit 7e982e
file, the user will only receive cookies from users listed in the file\&. If there is no
Packit 7e982e
~/\&.xauth/import
Packit 7e982e
file, the user will accept cookies from any other user\&.
Packit 7e982e
.PP
Packit 7e982e
If a user has a
Packit 7e982e
\&.xauth/export
Packit 7e982e
file, the user will only forward cookies to users listed in the file\&. If there is no
Packit 7e982e
~/\&.xauth/export
Packit 7e982e
file, and the invoking user is not
Packit 7e982e
\fBroot\fR, the user will forward cookies to any other user\&. If there is no
Packit 7e982e
~/\&.xauth/export
Packit 7e982e
file, and the invoking user is
Packit 7e982e
\fBroot\fR, the user will
Packit 7e982e
\fInot\fR
Packit 7e982e
forward cookies to other users\&.
Packit 7e982e
.PP
Packit 7e982e
Both the import and export files support wildcards (such as
Packit 7e982e
\fI*\fR)\&. Both the import and export files can be empty, signifying that no users are allowed\&.
Packit 7e982e
.SH "OPTIONS"
Packit 7e982e
.PP
Packit 7e982e
\fBdebug\fR
Packit 7e982e
.RS 4
Packit 7e982e
Print debug information\&.
Packit 7e982e
.RE
Packit 7e982e
.PP
Packit 7e982e
\fBxauthpath=\fR\fB\fI/path/to/xauth\fR\fR
Packit 7e982e
.RS 4
Packit 7e982e
Specify the path the xauth program (it is expected in
Packit 7e982e
/usr/X11R6/bin/xauth,
Packit 7e982e
/usr/bin/xauth, or
Packit 7e982e
/usr/bin/X11/xauth
Packit 7e982e
by default)\&.
Packit 7e982e
.RE
Packit 7e982e
.PP
Packit 7e982e
\fBsystemuser=\fR\fB\fIUID\fR\fR
Packit 7e982e
.RS 4
Packit 7e982e
Specify the highest UID which will be assumed to belong to a "system" user\&. pam_xauth will refuse to forward credentials to users with UID less than or equal to this number, except for root and the "targetuser", if specified\&.
Packit 7e982e
.RE
Packit 7e982e
.PP
Packit 7e982e
\fBtargetuser=\fR\fB\fIUID\fR\fR
Packit 7e982e
.RS 4
Packit 7e982e
Specify a single target UID which is exempt from the systemuser check\&.
Packit 7e982e
.RE
Packit 7e982e
.SH "MODULE TYPES PROVIDED"
Packit 7e982e
.PP
Packit 7e982e
Only the
Packit 7e982e
\fBsession\fR
Packit 7e982e
type is provided\&.
Packit 7e982e
.SH "RETURN VALUES"
Packit 7e982e
.PP
Packit 7e982e
PAM_BUF_ERR
Packit 7e982e
.RS 4
Packit 7e982e
Memory buffer error\&.
Packit 7e982e
.RE
Packit 7e982e
.PP
Packit 7e982e
PAM_PERM_DENIED
Packit 7e982e
.RS 4
Packit 7e982e
Permission denied by import/export file\&.
Packit 7e982e
.RE
Packit 7e982e
.PP
Packit 7e982e
PAM_SESSION_ERR
Packit 7e982e
.RS 4
Packit 7e982e
Cannot determine user name, UID or access users home directory\&.
Packit 7e982e
.RE
Packit 7e982e
.PP
Packit 7e982e
PAM_SUCCESS
Packit 7e982e
.RS 4
Packit 7e982e
Success\&.
Packit 7e982e
.RE
Packit 7e982e
.PP
Packit 7e982e
PAM_USER_UNKNOWN
Packit 7e982e
.RS 4
Packit 7e982e
User not known\&.
Packit 7e982e
.RE
Packit 7e982e
.SH "EXAMPLES"
Packit 7e982e
.PP
Packit 7e982e
Add the following line to
Packit 7e982e
/etc/pam\&.d/su
Packit 7e982e
to forward xauth keys between users when calling su:
Packit 7e982e
.sp
Packit 7e982e
.if n \{\
Packit 7e982e
.RS 4
Packit 7e982e
.\}
Packit 7e982e
.nf
Packit 7e982e
session  optional  pam_xauth\&.so
Packit 7e982e
      
Packit 7e982e
.fi
Packit 7e982e
.if n \{\
Packit 7e982e
.RE
Packit 7e982e
.\}
Packit 7e982e
.sp
Packit 7e982e
.SH "IMPLEMENTATION DETAILS"
Packit 7e982e
.PP
Packit 7e982e
pam_xauth will work
Packit 7e982e
\fIonly\fR
Packit 7e982e
if it is used from a setuid application in which the
Packit 7e982e
\fBgetuid\fR() call returns the id of the user running the application, and for which PAM can supply the name of the account that the user is attempting to assume\&. The typical application of this type is
Packit 7e982e
\fBsu\fR(1)\&. The application must call both
Packit 7e982e
\fBpam_open_session\fR() and
Packit 7e982e
\fBpam_close_session\fR() with the ruid set to the uid of the calling user and the euid set to root, and must have provided as the PAM_USER item the name of the target user\&.
Packit 7e982e
.PP
Packit 7e982e
pam_xauth calls
Packit 7e982e
\fBxauth\fR(1)
Packit 7e982e
as the source user to extract the key for $DISPLAY, then calls xauth as the target user to merge the key into the a temporary database and later remove the database\&.
Packit 7e982e
.PP
Packit 7e982e
pam_xauth cannot be told to not remove the keys when the session is closed\&.
Packit 7e982e
.SH "FILES"
Packit 7e982e
.PP
Packit 7e982e
~/\&.xauth/import
Packit 7e982e
.RS 4
Packit 7e982e
XXX
Packit 7e982e
.RE
Packit 7e982e
.PP
Packit 7e982e
~/\&.xauth/export
Packit 7e982e
.RS 4
Packit 7e982e
XXX
Packit 7e982e
.RE
Packit 7e982e
.SH "SEE ALSO"
Packit 7e982e
.PP
Packit 7e982e
\fBpam.conf\fR(5),
Packit 7e982e
\fBpam.d\fR(5),
Packit 7e982e
\fBpam\fR(8)
Packit 7e982e
.SH "AUTHOR"
Packit 7e982e
.PP
Packit 7e982e
pam_xauth was written by Nalin Dahyabhai <nalin@redhat\&.com>, based on original version by Michael K\&. Johnson <johnsonm@redhat\&.com>\&.