Solved

Printing via telnet

Posted on 1997-11-26
15
513 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

758 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

19 Experts available now in Live!

Get 1:1 Help Now