From abd05c70e3ef3f650629e96d3f62a223b5a53bca Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Sun, 23 May 2010 00:29:44 +0000 Subject: [PATCH] -Draft postscript for linux domain join, doesn't work git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6207 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/joindomain | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 xCAT/postscripts/joindomain diff --git a/xCAT/postscripts/joindomain b/xCAT/postscripts/joindomain new file mode 100644 index 000000000..028e284f8 --- /dev/null +++ b/xCAT/postscripts/joindomain @@ -0,0 +1,18 @@ +#First, set up kerberos, simple enough +DNSDOMAIN=`dnsdomainname` +UPDNSDOMAIN=`echo $DNSDOMAIN|tr a-z A-Z` +LDAPBASEDN=dc=`echo $DNSDOMAIN|sed -e 's/\./,dc=/'` +HOSTPRINC=`hostname` +MYPASS=`dd if=/dev/urandom bs=1024 count=1|md5sum` +authconfig --update --krb5realm=$UPDNSDOMAIN --enablekrb5kdcdns --enablekrb5 +(echo $TEMPHOSTPASS;echo $MYPASS;echo $MYPASS)|kpasswd $HOSTPRINC +(echo $MYPASS)|kinit $HOSTPRINC +KVNO=`kvno $HOSTPRINC|awk '{print $NF}'` +(echo add_entry -password -p vs99 -k $KVNO -e des;echo $MYPASS|wkt /etc/host.keytab)|ktutil + + +#ok, time for ldap +LDAPSRV=`host -t SRV _ldap._tcp.$DNSDOMAIN|awk '{print $NF}'` +sed -ie 's/#uri ldap:\/\/127.0.0.1/uri ldap:\/\/$LDAPSRV\//' /etc/nslcd.conf +sed -ie 's/# base dc.*/base $LDAPBASEDN/' /etc/nslcd.conf +authconfig --update --enableldap --ldapserver=$LDAPSRV --ldapbasedn=$LDAPBASEDN