3

I am looking for a command/script to disable the printing sharing feature via terminal. Does anyone have any idea or know how to go about doing this?

4

Use lpstat -v to get the appropriate printer name, then use:

lpadmin -p Printer_Name -o printer-is-shared=false
2

According to cupsctl's man page:

cupsctl --no-share-printers
1

Disable Printer Sharing: all printers

for printer in $(lpstat -p|awk '{ print $2}')
do
  lpadmin -p $printer -o printer-is-shared=false
done
0

Try the /usr/sbin/cupsdisable command.

mgagnon-mbp:~ mgagnon$ lpstat -p

printer c360 is idle.  enabled since Thu Mar 26 16:27:59 2015

mgagnon-mbp:~ mgagnon$ cupsdisable c360

mgagnon-mbp:~ mgagnon$ lpstat -p
printer c360 disabled since Thu Mar 26 16:29:08 2015 -
    Paused

mgagnon-mbp:~ mgagnon$ cupsenable c360

mgagnon-mbp:~ mgagnon$ lpstat -p
printer c360 is idle.  enabled since Thu Mar 26 16:29:16 2015
  • 1
    Doesn't that stop/start the printer entirely? Rather than just turning sharing off/on? – Alistair McMillan Mar 27 '15 at 1:02
  • Alistair, yes cupsdisable stops the printer for everyone. I should have paid closer attention to question! Thanks. – Michael Gagnon Mar 27 '15 at 17:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .