Skip to content

PAM module to move a kerberos credential from one ccache to another ccache

License

Notifications You must be signed in to change notification settings

cernops/pam_krb5_cc_move

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pam_krb5_cc_move

Pam session module to move a Kerberos credential cache from one location to another.

Default locations for source and destination are as below

session  optional pam_krb5_cc_move.so  source=FILE:/tmp/source destination=FILE:/tmp/destination debug

if the source cc is missing this is NOT considered an error.

Use case with SSHD and Kerberos

With SSHD and Kerberos authentication it is not possible to create a keytab at /run/user/<uid> since this directory does not exist when SSHD does the delegation. The workaround is have SSHD delegate to KEYRING and then this pam module can move the credential to the correct location.

  • Configure /etc/krb5.conf with cache of FILE:/run/user/%{uid}/krb5cc.
  • Run sshd with an environment of KRB5_CONFIG=/etc/krb5_sshd.conf to use a custom cache location for SSHD only.
# File /etc/krb5_sshd.conf
[libdefaults]
    default_ccache_name = KEYRING:persistent:%{uid}

include /etc/krb5.conf
  • Use two pam modules to create $XDG_RUNTIME_DIR and then move the credential there with each login.
session optional pam_xdg_runtime_dir.so
session optional pam_krb5_cc_move.so

Default source and destination in pam_krb5_cc_move is KEYRING:persistant:%{uid} and FILE:/run/user/%{uid}/krb5cc

Links

About

PAM module to move a kerberos credential from one ccache to another ccache

Resources

License

Stars

Watchers

Forks

Packages

No packages published