Friday, 13 April 2012

OS X automatically changing a password


This is a follow up from the post which describes the problems with 'locking' down a printer. I've finally decided that we are locking down the computer attached to the printer, and changing it's password each day so only people who know the password can print.

So, I've just tested "passwd" command and found it quite useful. It has given me a few ideas.


  • When typing "passwd" when you're already logged in
    • it assumes you're changing your password
    • It asks for your old one, a new one, and retype the new one. Done.
  • When typing in from an admin account "passwd stephenl"
    • it asks you as if you were the user whose password is being changed as before.
  • When doing this through root login (i.e. from Apple Remote Desktops send command)
    • it just asks for a new password twice. Easy.


So, I worked out two ways I could do this:

  1. I could simply have some scheduled tasks setup in ARD which sends these commands on certain days
  2. I could set up a totally self sufficient system when the machine is switched on, it looks at the day, and determines which password to use.
Number 1 is the easiest as I know how to do this.
Number 2 is harder as I'd have to write a script which:
  1. loads at startup
  2. uses root to change passwords
  3. finds out what day it is
  4. changes the password accordingly
Now I've written it out in logical order it doesn't sound too difficult.

Just found this post which describes how to simply make a startup script


No comments:

Post a Comment