-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
This commit is contained in:
parent
419d7a9be6
commit
abd05c70e3
18
xCAT/postscripts/joindomain
Normal file
18
xCAT/postscripts/joindomain
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user