54e0d006e0
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7193 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
19 lines
842 B
Plaintext
19 lines
842 B
Plaintext
#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 $HOSTPRINC -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
|