Setting up a printer in CentOS/Amazon Linux

Note: 

Download the printer driver from the printer support site and install the driver in the server. See the installation guide provided in the printer support site for more information.

  1. Connect to the server through SSH.
  2. Run the command $ sudo lpadmin -p <printername> -E -m <printer PPD file> -v smb://<printerserver>/<printername> to add the printer.
    Note: 

    Check printer driver documentation for the correct printer PPD file.

    In case the printer needs security access, run these commands:

    $ sudo service cups stop

    $ sudo nano /etc/cups/printers.conf

    -Set AuthInfoRequired value to username,password

    -Set DeviceURI value to smb://<domain>/<username>:<password>@<printserver>/<printername>

    $ sudo service cups start

  3. Run the command $ sudo lpoptions -p <printername> -o PageSize=A4 to update the default page size.
    Note: 

    When updating any configuration, run the command $ sudo service cups restart after every update.