Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Printing Question

Printing Question
Thread Tools
Fresh-Faced Recruit
Join Date: Sep 2004
Status: Offline
Reply With Quote
May 17, 2005, 08:07 AM
 
I want to know if it's possible (and how-to) to print from home to a printer at the office.

The office printer is an epson 1280 hooked up to an old g4 tower.
I connect to the g4 from home all the time but USB printer sharing doesn't seem to work unless I'm connected via ethernet (i.e. at the office) to that machine. I also have an old LW 630 at he office that is part of the office network, should I be giving that machine an IP addy and trying IP printing (also something I know very little about.)

Is there a way to do this?
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
May 17, 2005, 08:27 AM
 
It is possible, but it is not easy to configure a secure connection. The problem is that this would mean opening your computer to the whole internet. The protocols used (Apple Share (afp) or samba) are not secure enough to be opened towards the internet. So you would have to `tunnel' the connection; a tunnel is an encrypted pipe (imagine a pipe) which can contain pretty much any data stream, including smb and afp connections. This is how big companies do it.

The problem is to set up a server properly. In principle you can do it with OS X.

However, I do have another idea. You could write a script which creates a .pdf of your print job, sends over the .pdf via ssh, and then prints it out. You need to make sure you can print via the command line.
I don't suffer from insanity, I enjoy every minute of it.
     
Fresh-Faced Recruit
Join Date: Sep 2004
Status: Offline
Reply With Quote
May 17, 2005, 10:16 AM
 
Thanks OreoCookie,

That's a clever approach, I'll have to readup on AppleScript and give it a try.
     
Moderator
Join Date: May 2001
Location: Hilbert space
Status: Offline
Reply With Quote
May 17, 2005, 10:58 AM
 
Actually, a shell script would only be three lines or so. I don't think AppleScript by itself will do.

Here's a simple step-by-step instruction how you could do it.

1 Make sure your remote machine can be reached from outside

This depends on your network architecture in your office. In the simplest case, you have to enable port forwarding to that specific machine. If your company doesn't have a fixed IP, I would recommend using dyndns.org so you have a dns name whose IP is updated on a regular basis.

If you have a more sophisticated network, and each machine can be reached from the internet, it's even easier.


2 Create public and private SSH keys

Read here how to do it.


3 Make sure you can print from the command line

Open the Terminal and choose an appropriate document, e. g. a .pdf. Enter `lp "[name of pdf]"'. If the document is printed, you are set to go.


4 Create the print script on your remote machine

Open your text editor of choice on the remote machine.
Enter

lp -d [printer name] $1
(If the Epson printer is the default printer on the remote machine, lp $1 will suffice.)

and save it in a suitable directory under a suitable name, e. g. ~/Library/unix/remotePrint.sh. Use chmod 755 ~/Library/unix/remotePrint.sh to make it executable.


6 Script on your local machine

Create a script on your local machine and save it in a suitable directory.
It should contain something like

scp $1 [username on remote machine]@[name or ip of remote machine]:/tmp/
ssh [username on remote machine]@[name or ip of remote machine] /Users/Library/unix/remotePrint.sh


7 If you want, you can wrap this in a simple AppleScript.

do shell executes a shell script under AppleScript. Make sure to use the file name as parameter.

Then create a droplet on your desktop or so which allows you to print a document by dragging a pdf or so to the droplet.


Note that I'm just outlining the basic ideas here, this is by no means a complete solution.
I don't suffer from insanity, I enjoy every minute of it.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:41 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2