Some scenes of cups under ubuntu

Chapter 1: Some operating instructions

In the computer field, cups is the abbreviation of "Common UNIX Printing System", which is an open source printing system used to manage printing tasks on UNIX-like operating systems. cups provides a framework that allows users and programs to send print jobs to printers over a network or local connection, and also provides management, queuing, filtering and other functions.

The following are some commonly used cups commands:

Start and stop the CUPS service:
Start: sudo systemctl start cups
Stop: sudo systemctl stop cups
Restart: sudo systemctl restart cups
View status: sudo systemctl status cups

Manage printers :
List all printers: lpstat -p -d
Pause printers: cupsdisable printer_name
Resume printers: cupsenable printer_name Delete
printers: lpadmin -x printer_name
Add printers: lpadmin -p DZ_169 -E -v http://10.37.17.169:80

Manage print jobs:
List print jobs: lpq
Cancel print jobs: cancel job_id

Manage print queue:
Pause print queue: cupsdisable
Resume print queue: cupsenable

Manage CUPS configuration:
Edit the CUPS configuration file: sudo nano /etc/cups/cupsd.conf (you can use other text editors)
Reload the configuration: sudo systemctl reload cups

Other commands:
Print files: lp filename
Add files to the print queue: lp -d printer_name filename
View print job details: lpstat -o
View logs: tail -f /var/log/cups/error_log

Chapter 2: Some scenes

I want to access the web interface of CUPS (Common UNIX Printing System) on an Ubuntu virtual machine at IP address 192.168.1.132 from a browser on the machine at IP address 192.168.3.132. This requires some steps to set up port forwarding and access permissions. Here are the steps you can take:

  1. Set up CUPS on the Ubuntu virtual machine :
    Make sure that the CUPS service is correctly installed and configured on your Ubuntu virtual machine. You can install CUPS using the following command:

    sudo apt-get update
    sudo apt-get install cups
    

    You can then http://localhost:631ensure that CUPS is running properly and configured correctly by accessing its web interface on the virtual machine.

  2. Set up port forwarding :
    You need to set up port forwarding on the machine located at 192.168.3.132 to redirect access to the specific port on that machine to the CUPS service port of the Ubuntu virtual machine. Use SSH for port forwarding to map the CUPS port on 192.168.1.132 (usually 631) to an available port on 192.168.3.132, such as 8080.

    Run the following command on 192.168.3.132:

    ssh -L 8080:localhost:631 [email protected]
    

    where useris your username on the Ubuntu virtual machine and 192.168.1.132is the IP address of the virtual machine.

  3. Access the CUPS web interface via a browser :
    Now, on the machine located at 192.168.3.132, open your web browser and enter in the address bar http://localhost:8080. This will send your request to the CUPS service on the Ubuntu virtual machine via SSH port forwarding. You should be able to access the CUPS web interface and perform operations such as printer management.

Note that this setup requires a good network connection, a functioning SSH server and CUPS service, and that the necessary access permissions are set correctly. If any problems occur, you may want to check your firewall settings, SSH configuration, and access control settings for CUPS.

Guess you like

Origin blog.csdn.net/qq_43952288/article/details/132605023