Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

How to change SMB printer passwords Printers
Our company's Windows network requires periodic password changes, and each time I do this (via a Windows machine, BTW, since I don't know how to do this from a Mac), all my Windows networked printers break. One solution is to delete the printers from Printer Setup Utility and then re-add them, but this gets old fast, especially if you have several networked printers.

The easiest method I've found is to first change the passwords directly, and then restart PrintingServices. The passwords are stored in a root-owned file at /etc » cups » printers.conf, in a URL for each printer:
DeviceURI smb://USERNAME:password@Workgroup/path/to/printer
You can easily edit this file in Terminal.app with sudo vi /etc/cups/printers.conf (Type :1:$s/old_pword/new_pword to change them all at once!). Save the file, then restart CUPS: sudo SystemStarter restart PrintingServices.
    •    
  • Currently 2.56 / 5
  You rated: 3 / 5 (9 votes cast)
 
[23,692 views]  

How to change SMB printer passwords | 6 comments | Create New Account
Click here to return to the 'How to change SMB printer passwords' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to change SMB printer passwords
Authored by: krzysiek on Apr 02, '07 08:09:44AM
The Vim command should read:
      :1,$s/old_pass/new_pass/g
or, the short way ;)
      :%s/old_pass/new_pass/g


[ Reply to This | # ]
avoid printer passwords with LPD
Authored by: i5ao on Apr 02, '07 09:38:50AM

I had the same problem as the poster of this tip. Eventually, I re-added the printers in the Printer Browser using "IP Printer" w/ "Line Printer Daemon - LPD". To do this your printer needs a hostname or IP, but this should be pretty easy to figure out, depending on your company's network.

For example, the networked printer you want is called "foo". In the terminal, type

% host foo
foo.subnet.domain has address 10.0.23.45

So in the Printer Browser, use either "foo.subnet.domain" or 10.0.23.45 fro the printer address, after changing protocol to LPD.

YMMV...



[ Reply to This | # ]
avoid printer passwords with LPD
Authored by: dennymingus on Apr 03, '07 06:52:30AM

Let me share what I've done.

We use a printer accounting system, which requires that the username and password be passed as a parameter in the smb uri. LPD wouldn't be an option in this case.

I've created a script that I run when I've changed my password.

echo -n "Enter your username: "
read username
echo -n "Enter your password (what you type will not be printed to the screen): "
read -s password
echo " "
echo "If you are prompted for a password, enter your system administrator password"
#$domain and $servername must be defined
sudo lpadmin -p 1055CMBond -v smb://$username:$password@$domain/$servername/hp1055cmbond -P "/Library/Printers/PPDs/Contents/Resources/en.lproj/HP DesignJet 1055CM PS3.gz"
sudo /usr/bin/enable 1055CMBond
sudo /usr/sbin/accept 1055CMBond
#make the printer the default, may require system password
sudo lpoptions -d 1055CMBond
#At one point I thought this was necessary
#uncomment if you need it
#sudo killall -HUP cupsd


This will overwrite printers with the same name, so they are essentially deleted and re-created with the new password. You'll need to define your domain and server name. As well, you'll need to know the path to the PPD file for your specific printer. My advice would be to define the printers manually the first time, and then peek into your printers.conf file for the PPD paths.



[ Reply to This | # ]
How to change Windows network passwords from a Mac
Authored by: BiL Castine on Apr 03, '07 06:39:43AM
1. dismount all network shares
2. use the finder's "go-->connect to server"
3. type the server name or address and click "connect." the authentication dialog box appears.
4. BEFORE you log in, click on the gear icon in the pop-up menu (lower left of the authentication dialog) and choose "change password"

[ Reply to This | # ]
How to change Windows network passwords from a Mac
Authored by: rjbailey on Apr 03, '07 04:08:23PM

This sure looks helpful, but when I try it I don't have the popup menu you describe. Is this server-specific?



[ Reply to This | # ]
How to change Windows network passwords from a Mac
Authored by: BiL Castine on Apr 04, '07 03:33:01AM

this only works with AFP volumes, not SMB



[ Reply to This | # ]