/usr/share/doc/pam-devel/html
NameSizeModeActions
adg-author.html30980644editdlrm
adg-copyright.html36240644editdlrm
adg-example.html36760644editdlrm
adg-files.html22390644editdlrm
adg-glossary.html32860644editdlrm
adg-interface-by-app-expected.html624720644editdlrm
adg-interface-of-app-expected.html84570644editdlrm
adg-interface-programming-notes.html26140644editdlrm
adg-interface.html50190644editdlrm
adg-introduction-description.html33730644editdlrm
adg-introduction-synopsis.html26830644editdlrm
adg-introduction.html20640644editdlrm
adg-libpam-functions.html134490644editdlrm
adg-libpam_misc.html34210644editdlrm
adg-overview.html83570644editdlrm
adg-porting.html43060644editdlrm
adg-security-conv-function.html23460644editdlrm
adg-security-library-calls.html32030644editdlrm
adg-security-resources.html29030644editdlrm
adg-security-service-name.html45350644editdlrm
adg-security-user-identity.html55120644editdlrm
adg-security.html38240644editdlrm
adg-see-also.html22140644editdlrm
Linux-PAM_ADG.html86130644editdlrm
Linux-PAM_MWG.html88030644editdlrm
mwg-author.html30750644editdlrm
mwg-copyright.html36030644editdlrm
mwg-example.html20050644editdlrm
mwg-expected-by-module-item.html464570644editdlrm
mwg-expected-by-module-other.html83520644editdlrm
mwg-expected-by-module.html41170644editdlrm
mwg-expected-of-module-acct.html61870644editdlrm
mwg-expected-of-module-auth.html109680644editdlrm
mwg-expected-of-module-chauthtok.html79770644editdlrm
mwg-expected-of-module-overview.html64370644editdlrm
mwg-expected-of-module-session.html71260644editdlrm
mwg-expected-of-module.html43740644editdlrm
mwg-introduction-description.html39710644editdlrm
mwg-introduction-synopsis.html20280644editdlrm
mwg-introduction.html20320644editdlrm
mwg-see-also.html22310644editdlrm
mwg-see-options.html29960644editdlrm
mwg-see-programming-libs.html30150644editdlrm
mwg-see-programming-sec.html91410644editdlrm
mwg-see-programming-syslog.html47410644editdlrm
mwg-see-programming.html30780644editdlrm
Edit: /usr/share/doc/pam-devel/html/adg-security-user-identity.html (5512B)
4.4. The identity of the user

4.4. The identity of the user

The Linux-PAM modules will need to determine the identity of the user who requests a service, and the identity of the user who grants the service. These two users will seldom be the same. Indeed there is generally a third user identity to be considered, the new (assumed) identity of the user once the service is granted.

The need for keeping tabs on these identities is clearly an issue of security. One convention that is actively used by some modules is that the identity of the user requesting a service should be the current UID (user ID) of the running process; the identity of the privilege granting user is the EUID (effective user ID) of the running process; the identity of the user, under whose name the service will be executed, is given by the contents of the PAM_USER pam_get_item(3). Note, modules can change the values of PAM_USER and PAM_RUSER during any of the pam_*() library calls. For this reason, the application should take care to use the pam_get_item() every time it wishes to establish who the authenticated user is (or will currently be).

For network-serving databases and other applications that provide their own security model (independent of the OS kernel) the above scheme is insufficient to identify the requesting user.

A more portable solution to storing the identity of the requesting user is to use the PAM_RUSER pam_get_item(3). The application should supply this value before attempting to authenticate the user with pam_authenticate(). How well this name can be trusted will ultimately be at the discretion of the local administrator (who configures PAM for your application) and a selected module may attempt to override the value where it can obtain more reliable data. If an application is unable to determine the identity of the requesting entity/user, it should not call pam_set_item(3) to set PAM_RUSER.

In addition to the PAM_RUSER item, the application should supply the PAM_RHOST (requesting host) item. As a general rule, the following convention for its value can be assumed: NULL = unknown; localhost = invoked directly from the local system; other.place.xyz = some component of the user's connection originates from this remote/requesting host. At present, PAM has no established convention for indicating whether the application supports a trusted path to communication from this host.