All of our CentOS 6 machines have been joined to our active directory domain. Each of these machines eventually "loses" their domain membership, which breaks authentication for AD users.

I created a simple shell script to force a domain join every five hours (using cron). The script is seems to be running without error, but machines STILL lose their domain membership.

Any suggestions?

Here's the script (with password obscured)

    -U Administrator%xxxxxxxxxxxxxxxxx
  • What do the logs say? – slm Oct 24 '14 at 12:36
  • Which logs do you mean? – Jim Stowe Oct 24 '14 at 12:42
  • I'd start with /var/log/messages, and do a ls -lr /var/log/ and see what files are towards the bottom, these are the ones that have activity in them. Also if you have /var/log/samba I'd look in there as well. The net command is part of Samba. – slm Oct 24 '14 at 13:02

You could use the kerberos keytab file:

net ads join createupn=host/`hostname -f`@ADIRE.DOMAIN.CO.UK -U priviledged_user
net ads keytab create
net ads keytab add host/`hostname -f`@ADIRE.DOMAIN.CO.UK

Then use the keytab file in your samba configuration:

$ grep -i keytab /etc/samba/smb.conf
    kerberos method = secrets and keytab

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.