08.01.2013 Views

AIX and Linux Interoperability - IBM Redbooks

AIX and Linux Interoperability - IBM Redbooks

AIX and Linux Interoperability - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.8 Migrating users to Kerberos<br />

In Chapter 2, “Centralized user management” on page 15, we describe how to<br />

move users from local map files to the LDAP directory. The effort needed to<br />

migrate a few tens of users is close to that for a few thous<strong>and</strong>s of users. That is<br />

not the case with Kerberos.<br />

Kerberos passwords are stored in a decryptable format. One simply cannot<br />

convert crypt or md5 hashes into the Kerberos format. In order to generate a<br />

user principal, the administrator has to have the corresponding password in clear<br />

text. On the other h<strong>and</strong>, the password hashes on UNIX cannot be decrypted. If<br />

the number of your users is small, you may invite all of them to stop by <strong>and</strong><br />

negotiate new passwords. If there are many users, then this is probably not an<br />

option.<br />

One possibility may be to harvest user passwords during the migration phase. To<br />

do this, you probably have to modify an existing authentication module or write<br />

another for this purpose. We are not aware of any such module at the moment,<br />

though rumor has it that there is a PAM module available for this purpose. It may<br />

also be possible to use strategically located network sniffers, but your security<br />

policy may prohibit that. The security policy may prohibit collecting user<br />

passwords as well, so you should discuss the matter with management. For<br />

example, if the new authentication module is named XPF, which simply appends<br />

the user name <strong>and</strong> the password to a file, <strong>and</strong> the authentication currently in use<br />

is LDAP, we can set up the following SYSTEM grammar:<br />

SYSTEM = LDAP AND XPF<br />

It is possible to run the kadmin program in batch mode. If there is a file with one<br />

user name <strong>and</strong> a password per line separated by white space, the following shell<br />

script may be used to create principals:<br />

R=WEEORG.COM<br />

CACHE=my.cache<br />

ADM=admin/admin<br />

kinit -c $CACHE -S kadmin/admin $ADM<br />

while read user pass; do<br />

if kadmin -c $CACHE -p $ADM -q "getprinc $user@$R" 2>/dev/null |<br />

grep -qws $user@$R<br />

then<br />

echo "WARNING: principal $user@$R already exists"<br />

else<br />

kadmin -c $CACHE -p $ADM -q "addprinc -pw $pass $user@$R”<br />

fi<br />

done < userpwd.txt<br />

This is a very sensitive business <strong>and</strong> the file containing user data must be<br />

scrutinized before running the script.<br />

Chapter 3. Single sign-on 81

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!