Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I could've sworn I was able to setup printers by:

  • setup first host with lpadmin
  • setup additional hosts with for loop: wherein
    • stop cups
    • copy printers.conf over
    • start cups
for host in 10.10.17.{10,11,{13..15},{25..29}};do
    ssh root@$host '
    service cups stop && 
    scp -o StrictHostKeyChecking=no root@ 
    /etc/cups/ppd/ &&
    scp -o StrictHostKeyChecking=no root@
    /etc/cups/ && service cups start && lpoptions -d Lab1_Print2 &&
    echo printer installed on $(hostname) && echo default printer is $(lpstat -d)
    && echo printing test page .... && lp<<<TEST_PAGE_FROM_$(hostname)'

Here's the output I get:

root@'s password:   
* Stopping Common Unix Printing System: cupsd       
Permission denied, please try again.    
Permission denied, please try again.    
Permission denied (publickey,password).

Is this not possible, or, has some part of the remote environment changed? Maybe too much Dust-Off in here.

Incidentally, I have an expect script, fabric and rex files for this stuff but tried to one-off this and am pretty sure this worked before.

share|improve this question
Can you execute the same commands individually and manually? –  Khaled Jan 27 '12 at 4:38
I can ssh back but didn't try scp. The lp commands all work manually –  Bubnoff Jan 27 '12 at 4:42
was having issues with fabric and expect on two of those hosts as well. I think the first two hosts were having issues and I ctrl-C'd out. They are clones so ...maybe a reboot? –  Bubnoff Jan 27 '12 at 4:45
Looks like sshd configuration is different from other hosts (maybe a PermitRootLogin is missing) –  sendmoreinfo Mar 5 '12 at 7:10
They are cloned so the sshd config is the same. I think the first 2 hosts were on the fritz. This worked on the others and a reboot fixed the whatever issues were going on with the first two. Really weird though ...they appeared to be working fine. –  Bubnoff Mar 6 '12 at 15:20

Your Answer


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

Browse other questions tagged or ask your own question.