Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to make a samba client participating in an Active Directory environment change its computer account password in the domain on a regular basis? (More information about computer account passwords in this Microsoft blog.)

We clean up "stale" computer accounts occasionally, and we identify candidates for cleanup by the age of the computer account password. This works great for Windows, but we find our non-Windows systems don't manage that value like Windows does. I know the setting to make a NetApp Filer maintain its password (options cifs.weekly_W2K_password_change on), just looking for the same type of setting on samba or other *nix systems that can participate in Active Directory.

Thanks for any help you can provide!

share|improve this question
up vote 1 down vote accepted

A cron-job with net ads changetrustpw run as root in it should accomplish what you're looking for.

share|improve this answer
Thanks! Will give it a try and post results, sounds like that might do it. – Matt Apr 7 '11 at 22:42
Took me a while to try this, but this did exactly what I needed. Thanks again! – Matt Apr 27 '11 at 20:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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