README 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. pam_xauth — PAM module to forward xauth keys between users
  2. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  3. DESCRIPTION
  4. The pam_xauth PAM module is designed to forward xauth keys (sometimes referred
  5. to as "cookies") between users.
  6. Without pam_xauth, when xauth is enabled and a user uses the su(1) command to
  7. assume another user's privileges, that user is no longer able to access the
  8. original user's X display because the new user does not have the key needed to
  9. access the display. pam_xauth solves the problem by forwarding the key from the
  10. user running su (the source user) to the user whose identity the source user is
  11. assuming (the target user) when the session is created, and destroying the key
  12. when the session is torn down.
  13. This means, for example, that when you run su(1) from an xterm session, you
  14. will be able to run X programs without explicitly dealing with the xauth(1)
  15. xauth command or ~/.Xauthority files.
  16. pam_xauth will only forward keys if xauth can list a key connected to the
  17. $DISPLAY environment variable.
  18. Primitive access control is provided by ~/.xauth/export in the invoking user's
  19. home directory and ~/.xauth/import in the target user's home directory.
  20. If a user has a ~/.xauth/import file, the user will only receive cookies from
  21. users listed in the file. If there is no ~/.xauth/import file, the user will
  22. accept cookies from any other user.
  23. If a user has a .xauth/export file, the user will only forward cookies to users
  24. listed in the file. If there is no ~/.xauth/export file, and the invoking user
  25. is not root, the user will forward cookies to any other user. If there is no ~
  26. /.xauth/export file, and the invoking user is root, the user will not forward
  27. cookies to other users.
  28. Both the import and export files support wildcards (such as *). Both the import
  29. and export files can be empty, signifying that no users are allowed.
  30. OPTIONS
  31. debug
  32. Print debug information.
  33. xauthpath=/path/to/xauth
  34. Specify the path the xauth program (it is expected in /usr/X11R6/bin/xauth,
  35. /usr/bin/xauth, or /usr/bin/X11/xauth by default).
  36. systemuser=UID
  37. Specify the highest UID which will be assumed to belong to a "system" user.
  38. pam_xauth will refuse to forward credentials to users with UID less than or
  39. equal to this number, except for root and the "targetuser", if specified.
  40. targetuser=UID
  41. Specify a single target UID which is exempt from the systemuser check.
  42. EXAMPLES
  43. Add the following line to /etc/pam.d/su to forward xauth keys between users
  44. when calling su:
  45. session optional pam_xauth.so
  46. IMPLEMENTATION DETAILS
  47. pam_xauth will work only if it is used from a setuid application in which the
  48. getuid() call returns the id of the user running the application, and for which
  49. PAM can supply the name of the account that the user is attempting to assume.
  50. The typical application of this type is su(1). The application must call both
  51. pam_open_session() and pam_close_session() with the ruid set to the uid of the
  52. calling user and the euid set to root, and must have provided as the PAM_USER
  53. item the name of the target user.
  54. pam_xauth calls xauth(1) as the source user to extract the key for $DISPLAY,
  55. then calls xauth as the target user to merge the key into the a temporary
  56. database and later remove the database.
  57. pam_xauth cannot be told to not remove the keys when the session is closed.
  58. AUTHOR
  59. pam_xauth was written by Nalin Dahyabhai <nalin@redhat.com>, based on original
  60. version by Michael K. Johnson <johnsonm@redhat.com>.