[OpenAFS] openssh-3.7.1, pam and no token after login

Douglas E. Engert deengert@anl.gov
Mon, 15 Mar 2004 10:18:23 -0600


This is a multi-part message in MIME format.
--------------18947210788547DE88D1126A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Well, I had the same problems, and had proposed some solutions. 
I am going with the attached mods to replace the k_afs calls
with a call to 

Matthew Hoskins wrote:
> 
> This thread seems to have died...  Did anyone ever find a combination of
> patches/config options that allow a modern version of openssh to get a
> pag+token?
> 
> I have tried just about every combination of UsePAM,
> UsePrivilegeSeparation, 3.7p and 3.8p versions.  My platform is solaris 8.


Well, I had the same problems, and had proposed some solutions. 
I am going with the attached mods to OPenSSH-3.8 to replace the k_afs calls
with a call to get_afs_token. This does a syscall and fork/execs
your favorite program to get a token using the passed environment. 
(We are a K5 only so the environemt is exprected to have KRB5CCNAME
set from PAM the Kerberos user/password, or delegated GSSAPI credentials.)  

Have it working on three releases of Solaris, 4 releases of HP UX,
SGI and Linux.   



-- 

 Douglas E. Engert  <DEEngert@anl.gov>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439 
 (630) 252-5444
--------------18947210788547DE88D1126A
Content-Type: application/x-unknown-content-type-cfile;
 name="gafstoken.c"
Content-Disposition: inline;
 filename="gafstoken.c"
Content-Transfer-Encoding: base64

LyogZ2Fmc3Rva2VuLmMgCgoJQSBnZW5lcmljIHJvdXRpdWUgdG8gZ2V0IGFuIEFGUyB0b2tl
biBieSBjYWxsaW5nCglhbiBleHRlcm5hbCBwcm9ncmFtLiAKCglUaGlzIHJvdXRpbmUgaXMg
Z2VuZXJpYyBpbiB0aGF0IGl0IGRvZXMgbm90IGRlcGVuZCBvbiAKCWFueSBzcGVjaWZpYyBp
bXBsZW1lbnRhdGlvbiBvZiBBRlMsIG9yIEtlcmJlcm9zLgoJVGhpcyB3aWxsIGFsbG93IGEg
ZGVhbW9uIHRvIGJlIGNvbmZpZ3VyZWQsIGNvbXBpbGVkCglhbmQgbGlua2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AtMTsgLyogc2VlIGVycm5vICovCgl9CgoJaWYgKHBpZCA9PSAwKSB7CQoJ
CS8qIERvbid0IHdhbnQgYW55IG91dHB1dCBjb25mdXNpbmcgdGhlIGRlYW1vbiAqLwoJCWNs
b3NlKDEpOwoJCW9wZW4oIi9kZXYvbnVsbCIsT19XUk9OTFkpOwoJCWNsb3NlKDIpOwoJCW9w
ZW4oIi9kZXYvbnVsbCIsT19XUk9OTFkpOwoKCQlpZiAoZW52KQoJCQlleGVjdmUocHBhdGgs
IGFyZ3MsIGVudik7CgkJZWxzZQoJCQlleGVjdihwcGF0aCwgYXJncyk7CgkJZXhpdCgxMjcp
OyAvKiBzaG91bGQgbmV2ZXIgZ2V0IGhlcmUgKi8KCX0KCQkKCXdoaWxlICh3YWl0cGlkKHBp
ZCwgJnN0YXR1cywgMCkgPCAwKSB7CgkJaWYgKGVycm5vICE9IEVJTlRSKQoJCWJyZWFrOwoJ
fQoKCS8qIHdlIGNvdWxkIHNldCBhIHJldHVybiBjb2RlIGJhc2VkIG9uIHN0YXR1cywKCSAq
IGJlIHdlIHdhbnQgdG8gZ28gb24gd2l0aCBvciB3aXRob3V0IGEgdG9rZW4gKi8KCglyZXR1
cm4gMDsKfQo=
--------------18947210788547DE88D1126A
Content-Type: text/plain; charset=us-ascii;
 name="servconf.patch"
Content-Disposition: inline;
 filename="servconf.patch"
Content-Transfer-Encoding: 7bit

*** ,servconf.c	Wed Mar  3 13:21:19 2004
--- servconf.c	Wed Mar  3 13:23:22 2004
***************
*** 308,314 ****
  	{ "kerberosauthentication", sKerberosAuthentication },
  	{ "kerberosorlocalpasswd", sKerberosOrLocalPasswd },
  	{ "kerberosticketcleanup", sKerberosTicketCleanup },
! #ifdef USE_AFS
  	{ "kerberosgetafstoken", sKerberosGetAFSToken },
  #else
  	{ "kerberosgetafstoken", sUnsupported },
--- 308,314 ----
  	{ "kerberosauthentication", sKerberosAuthentication },
  	{ "kerberosorlocalpasswd", sKerberosOrLocalPasswd },
  	{ "kerberosticketcleanup", sKerberosTicketCleanup },
! #if defined(USE_AFS) || defined(ANL_AFS_PAG)
  	{ "kerberosgetafstoken", sKerberosGetAFSToken },
  #else
  	{ "kerberosgetafstoken", sUnsupported },

--------------18947210788547DE88D1126A
Content-Type: text/plain; charset=us-ascii;
 name="session.patch"
Content-Disposition: inline;
 filename="session.patch"
Content-Transfer-Encoding: 7bit

*** ,session.c	Wed Mar  3 13:31:56 2004
--- session.c	Wed Mar  3 13:31:56 2004
***************
*** 58,66 ****
--- 58,70 ----
  #include "session.h"
  #include "monitor_wrap.h"
  
+ #ifdef ANL_AFS_PAG
+ int get_afs_token(char * pgm, char ** env, char *homedir, int setpag);
+ #else
  #if defined(KRB5) && defined(USE_AFS)
  #include <kafs.h>
  #endif
+ #endif
  
  #ifdef GSSAPI
  #include "ssh-gss.h"
***************
*** 1453,1458 ****
--- 1457,1470 ----
  	 */
  	environ = env;
  
+ #ifdef ANL_AFS_PAG
+ 	/* Get PAG and AFS token using external program and KRB5CCNAME */
+ 	if (options.kerberos_get_afs_token) {
+ 		debug("Getting AFS PAG and token");
+ 		get_afs_token(NULL, env, pw->pw_dir, 1);
+ 	}
+ #else
+ 
  #if defined(KRB5) && defined(USE_AFS)
  	/*
  	 * At this point, we check to see if AFS is active and if we have
***************
*** 1477,1482 ****
--- 1489,1495 ----
  		krb5_afslog_home(s->authctxt->krb5_ctx,
  		    s->authctxt->krb5_fwd_ccache, NULL, NULL, pw->pw_dir);
  	}
+ #endif
  #endif
  
  	/* Change current directory to the user\'s home directory. */

--------------18947210788547DE88D1126A--