Solved

Printing via telnet

Posted on 1997-11-26
15
514 Views
Last Modified: 2010-04-21
Is there a way to be able to print via Telnet?

I need to be able to print to a machine-attached printer from which I am telnetting to a remote host, running pine.  I do not have access to the config settings under pine, but I can print to a "terminal-attached printer" by default

Thanks

Vladislav
0
Comment
Question by:davidzon
  • 7
  • 3
  • 2
  • +3
15 Comments
 
LVL 1

Expert Comment

by:dhughes111797
ID: 2008045
did you already try 'Y' for print? (press O in pine and
you should see it)

It uses VT100 escape sequences to print. Of course, it will
only work if your using some sort of emulation that supports
passing the VT100 escape sequences back for printing..

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008046
Yes, I've tried the Y to print.  It scrolls the message past my face and telnet does not pick up the print job.

Is there a version of telnet for BSDI (or source code that I can compile) out there that can be used so that when I print through pine (y to print) it will pass it on to the local LPD daemon?

0
 
LVL 1

Expert Comment

by:dhughes111797
ID: 2008047
You could take the source from NetBSD or FreeBSD and
compile it to support that. But you'll have to integrate
that in yourself. The telnet client doesn't support that
by default (sending to lpd). It'd probably be easier to
just rcp the file back and print it that way.. (or use
ssh and scp for a more secure way to do it)

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008048
Hrmm... What clients are you aware of other than ssh that do this?  I would hate to have to install ssh client / daemon.


0
 
LVL 1

Expert Comment

by:dhughes111797
ID: 2008049
The only other way would be to write your own simple
client/server program to do it yourself. (in Perl for
instance - server running on your machine listens to
a connection on a port, receives file, and then prints
it using lpr)

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008050
Anything server-based is not an option due to a possible security threat.  

I can not be the only one who has been faced with this problem!  Someone must have done this before...

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008051
Anything server-based is not an option due to a possible security threat.  

I can not be the only one who has been faced with this problem!  Someone must have done this before...

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:wjg
ID: 2008052
Two methods I can think of: 1) Run script(1) to capture the
output of your whole session and then some filter to extract
the stuff you want to print and 2) Try to solve this with
expect. Expect is available free on most TCL sites and can
probably be used to catch the vt100 printer escape sequence
for automagical redirection of the displayed printjob onto a
local printer (I haven't used expect for quite some time now -
no guarantee that this will work).
0
 
LVL 4

Expert Comment

by:jlms
ID: 2008053
Save the file in pine.
Copy it to your machine (ftp,rcp).
Print it.

If you are working in a UNIX machine (not a terminal) you should use the normal procedure for remote printing.

Please be more specific about how things are: type of machine and OS where you are could be a good start.

0
 

Expert Comment

by:grantk
ID: 2008054
Assuming the printer is attached to a system running lpd, just pipe the message to "lpr -Pprintername".

If the printer's on a Unix system, it should have lpd on it already, or you can download it. NT also has a LPD which comes with it.

So, what you'd need to do is:
1) set up lpr on the client
2) set up lpd on the server

For the client, you will need to create or change /etc/princap (as root, or the sysadmin must do it).

myprinter|aliasformyprinter|:\
:lp=:rm=remote.printer.ip.address.com:rp=raw:sd=/var/spool/lpd/myprinter:lf=/var/spool/lpd/myprinter-errs:

Then you can use "lpr -Pmyprinter" to print.


For the server, you'll need to read the docs with the program, but its usually pretty simple.


0
 
LVL 1

Accepted Solution

by:
tiago earned 100 total points
ID: 2008055
Your telnet must support printing to the current device (stdout).
Also, you must print using "attached-to-ansi" in Pine (in your case, the "terminal-attached" printer).

I know only one telnet that can do this, and it comes with the
Exceed package.
0
 
LVL 1

Author Comment

by:davidzon
ID: 2008056
If you can tell me where to get this package, I will give you a grade of A :>

thanks!

VSD

0
 
LVL 1

Expert Comment

by:tiago
ID: 2008057
0
 
LVL 1

Author Comment

by:davidzon
ID: 2008058
Excellent answer!

Thanks!

0
 
LVL 1

Author Comment

by:davidzon
ID: 2008059
Excellent answer!

Thanks!

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now