Showing posts with label passwd. Show all posts
Showing posts with label passwd. Show all posts

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


Friday, 30 March 2012

Password for printing on OS X 10.6 and changing every day

Here's some info:

The need a password tickbox in mcxprinting has limiting effects. It appears in Photoshop that it only prompts for a password if you change the print settings for the printer! Seems to only stop you if you're using the OS X printer interface. Any other interface might get around the password facility.

I suppose one option is to see if the CUPS printing facility has an admin password thingy.

Alternatively, you could just have one user which can log into the machine.

One thing we need to do is to get something automatic in place which automatically changes the password depending on the day.

Found this which describes the use of passwd command line utility to change a users password. We could set up something automatic which would change the administrators password every day and loop.

Another thought I had was to share the printer with the server, but call the instance on the machine something miscellaneous like -error-, and have another printer set up which connects to the server. That way we can use it like any other! I think this is the best solution yet.

So, I tried to setup a network printer:

  1. I set up the printer on the machine and called it "-error1-" so no-one would use it
  2. ticked the "printer sharing" box in system preferences
    1. also ticked the windows sharing box
  3. I read somewhere it was best to turn the firewall on, so I did. I checked to see the exceptions and printing and smb were listed
  4. Next I went to the windows 2000 server added a 'local port' printer
    1. using port "\\123.45.67.89\-error1-" and used the right windows driver for it so papercut would be able to work out paper size etc.
    2. I shared this printer with the name "n239-Ep7600"
  5. I did a test print from the windows server and it came out fine, although it wanted the roll paper instead of sheet paper feed.
  6. On the Mac I set up the networked printer, using LPR, the ip address of the server and the queue name "N239-Ep7600"
    1. gave it the correct print driver
  7. I performed a test print from the OS X machine and it came up with some sort of "rasterize" error.
/Library/Printers/EPSON/InkjetPrinter2/Filter/rastertoescpII.app/Contents/MacOS/rastertoescpII failed

I can only assume that the print driver cannot cope with being sent through a network, and has to "rasterize" it on the fly?

Another option is to have the print queue paused for every printjob which requires an administrator to unpause it. Found this post which is for os x 10.5 and involves CUPs config file.