https://github.com/xkjyeah/sshlpr2
LPR over SSH Driver
https://github.com/xkjyeah/sshlpr2
Last synced: about 2 months ago
JSON representation
LPR over SSH Driver
- Host: GitHub
- URL: https://github.com/xkjyeah/sshlpr2
- Owner: xkjyeah
- License: gpl-3.0
- Created: 2013-02-13T00:20:08.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-19T18:53:48.000Z (over 12 years ago)
- Last Synced: 2025-04-23T00:42:48.142Z (about 2 months ago)
- Language: Shell
- Size: 301 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: ChangeLog
- License: COPYING
Awesome Lists containing this project
README
sshlpr2
INTRODUCTION
When your printer is connected to your SSH server, but not to you, you can
use sshlpr2 to create a CUPS printer that behaves like a remote server.Similar work was done by Andre Masella. His original sshlpr script can be
found athttp://www.masella.name/technical/sshlpr.html
The original version of sshlpr has two problems:
(1) Requires your SSH server to accept public key authentication. Password
authentication will certainly fail, because when ssh is run by CUPS it
is not able to open a terminal.(2) Requires CUPS to run su, which will also fail because CUPS is not
connected to a terminal.To avoid the su problems, sshlpr2 has a simple server daemon that accepts
jobs submitted to it (via the sshlpr backend) and forwards the jobs to
clients attached to it (via sshlpr_client).sshlpr_client can be run in an X environment, so that you can launch xterm
and key in your password. sshlpr_client is setuid lp, in order to allow you
to connect to sshlprd.INSTALLATION
On a regular Ubuntu system, type:
$ ./configure; make; sudo make install
If you are on other Linux/Mac system, have a look at the configure options
specific to sshlpr2:--with-cups-backend CUPS backend directory, e.g. /usr/lib/cups/backend
--with-socket-dir Socket directory, e.g. /var/sshlpr
--with-lpuser Username to setuid the CUPS backend and clientHOW IT WORKS
0. Initialization
a) sshlprd is running.
b) Some user runs sshlpr_client, which connects to sshlprd1. sshlpr
a) Creates a FIFO in /tmp
b) Submits job request to sshlprd2. sshlpr_client
a) Receives the job request from sshlprd
b) Executes sshlpr_helper, passing parameters from the job request
to sshlpr_helper3. sshlpr_helper
a) Reads the parameters
b) Starts an xterm process that:
i] Reads from the FIFO, and pipes the output to...
ii] ... an ssh process that runs the ...
iii] ... lpr process on the remote endHOW TO USE IT
After installation, create a printer based on the sshlpr2 backend on
sshlpr://[email protected]/Pem_CC_1_BW
Unlike the original sshlpr, the local user does not have to be specified,
because you will always execute ssh as the user that created the print job.SPECIAL NOTE TO UNIVERSITY OF CAMBRIDGE USERS
To discover your list of printers:
ssh @linux.pwf.cam.ac.uk 'lpstat -P -a'