Easter Project #1
Folder Actions Via SSH - Retrieving Files on Your Mac From a PC
You’re going to be away from your Mac for the holiday weekend? What if you need some important files from your G5 while you’re gone? What if you only have access to a PC at Aunt Millie’s house?
We’ve still got ways to connect and retrieve files. Like using SSH to mail an attachment from a remote machine. You don’t need a screencast, Murphy’s already given you all the pieces.
First, set up a Folder Action on the machine you’ll be connecting to via SSH. Murphy has a screencast on sending email attachments to a predetermined address. Make sure your router lets port 22 in. You can learn more about port forwarding in the screencast on VNC.
Then you can make an SSH connection to the computer from just about anywhere. Use the zip command to package up multiple files if you’re not just emailing a lone file. Copy the file to your Folder Action equipped folder using SSH. The Folder Action will still kick in and email the file for you.
Obviously there are tools like rsync and scp - but of your needs are specialized a Folder Action could be your cure.
If you need to SSH from a Windows machine download PuTTY. PuTTY’s single exe is a snap to use. You should probably have a copy on your thumb-drive for convenient access.
Using PuTTy isn’t exactly the same as running a Terminal session on your Mac. For instance, you can’t use rsync to copy files from the PC to the remote Mac. If transferring files is a pressing need you can take a look at PSFTP and PSCP.
Here are the posts with information relevant to the task:
- Folder Actions - How to email files by dropping them in a Finder folder.
- Chicken of the VNC - The screencast includes basic instructions for port forwarding.
- Remote Login with SSH - Running a secure Terminal session on a remote machine. Also - look at SSH Without a Password.
- Zip - Packaging multiple files into a single file.
With the information in those screencasts you can extend the power of Folder Actions to SSH. Murphy’s not saying you’ll want to use this to email files - it’s just an example to illustrate the possibilities.
Some readers have pointed out that an Automator Droplet might be more useful than Folder Actions for mailing files. But you can’t trigger the Droplet from an SSH session like you can with Folder Actions. The Droplet has its benefits, but so do Folder Actions.
| Permalink
Leave a comment