Git Product home page Git Product logo

automator-scp's Introduction

automator-scp

This project provides Mac OS X Automator actions for downloading and uploading files using the secure copy (scp) protocol.

Download with scp v2.0

This action copies files or folders from the specified server using scp. scp must be able to automatically authenticate with the client, for example, using SSH public key authentication.

Download with SCP screenshot

The most recent version of Download with scp is version 2.0 (released 2010/03/27) and is available in the releases area. This version is for Mac OS X 10.5+.

History

  • 2010/03/27: version 2.0: complete rewrite in Objective-C; better error handling, compatibility with Mac OS X 10.6, update mechanism
  • 2007/04/07: version 1.0: initial release

Upload with scp v2.0

This action copies files or folders to the specified server using scp. scp must be able to automatically authenticate with the client, for example, using SSH public key authentication.

Upload with SCP screenshot

The most recent version of Upload with scp is version 2.0 (released 2010/03/25) and is available in the releases area. This version is for Mac OS X 10.5+.

History

  • 2010/03/25: version 2.0: complete rewrite in Objective-C; better error handling, compatibility with Mac OS X 10.6, update mechanism
  • 2010/03/21: switch to Google code for project hosting
  • 2008/07/01: version 1.0.3.4: fixed bugs in filename matching
  • 2007/07/25: version 1.0.3.3: fixed return values so correct aliases are returned
  • 2007/06/11: version 1.0.3.2: enhanced interface for multiple prompts
  • 2007/04/07: version 1.0.3.1: changed interface layout
  • 2007/03/26: version 1.0.3: added “Prompt for destination path for each file”
  • ????/??/??: version 1.0.2: lost to the ravages of time
  • 2005/07/17: version 1.0.1: user interface improvements
  • 2005/07/13: version 1.0: initial release

About this project

This software has been developed by Douglas Stebila and was originally hosted at http://www.douglas.stebila.ca/code/.

The source code for this project is open source and available under the New BSD license. The project makes use of code from the excellent BWToolkit framework.

Setup SSH Public Key Authentication

When you use scp and ssh on the command-line, you might be used to being prompted for your username and password and typing them in. Because the Upload with scp Automator action works in batch mode, it doesn't allow you to type in your password. You'll need to use an automatic form of authentication – SSH public key authentication — for the Upload with scp Automator action to work correctly.

This document describes how to setup SSH public key authentication. It assumes basic familiarity with the command-line.

Goal

By following the steps in this document, you will learn how to create an SSH public key / private key pair on your computer, install the public key on the server you want to login to, and install the private key in your Mac OS X keychain.

System requirements

  • Your computer: Mac OS X 10.5.1 or higher
  • The server: An account on the server that you can login to with SSH and that you can copy files to using scp (on the command-line).

Terminal

You will need to execute commands on the command-line. You can use Terminal.app, which can be found in the /Applications/Utilities folder.

In this tutorial, you will see code samples of the form:

$ whoami
jsmith

The line starting with $ denotes the prompt. You should type what appears after the $ and hit the return key. The output appears on the following line(s). In this case, the user typed the command whoami, hit return, and the whoami program printed their username.

Phase 1: Generate an SSH key pair

In this phase, we will generate your SSH public key / private key pair and store them on your computer.

Create a folder on your computer that will store your SSH keys.
$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
Generate your SSH public key pair.

You will be prompted to pick a new password to protect your private key. You should pick a secure password that is at least 8-10 characters long and hard for someone to guess; you will not need to remember this password on a day-to-day basis, so you should pick a strong password.

$ ssh-keygen -q -t rsa -b 2048 -f ~/.ssh/id_rsa
Enter passphrase (empty for no passphrase): …
Enter same passphrase again: …
$ chmod 600 ~/.ssh/*

Phase 2: Copy your SSH public key to the server

In this phase, we will copy your SSH public key to the remote server. In the following, replace jsmith with your username on the remote server and example.com with the domain name (or IP address) of the remote server.

Copy your SSH public key to the remote server.

When prompted, enter your password for your account on the remote server.

$ scp ~/.ssh/id_rsa.pub [email protected]:
[email protected]'s password: …
id_rsa.pub
Login to the remote server.

When prompted, enter your password for your account on the remote server.

$ ssh [email protected]
[email protected]'s password: …
Create a folder on the remote server for your SSH public key.
$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
Add your SSH public key to the list of accepted public keys for your account.
$ cat id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys
$ rm ~/id_rsa.pub
Log out of the remote server.
$ logout
Connection to example.com closed.

Phase 3: Testing SSH public key authentication

Finally, we'll test logging in to the remote server using our new SSH public key.

This time, instead of being prompted for your remote server password in the Terminal, a dialog box like the one below should pop up.

SSH public key authentication in Keychain

Enter the password that you chose back in Phase 1 for your SSH private key. Then click "Remember password in my keychain" to save that password: you won't need to enter that password every time you try to login to the remote server. Since the keychain encrypts all of its contents under your Mac OS X password, its contents are safe.

Log out of the remote server and close Terminal.app.

$ logout
Connection to example.com closed.
$ logout

Congratulations!

If you successfully logged in to the server in Phase 3, entered your password in the dialog box that popped up, and saved the password in your keychain, you are ready to use the Upload with scp Automator action.

Credits

These SSH public key authentication instructions are based on information in the following sources:

automator-scp's People

Contributors

dstebila avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

automator-scp's Issues

"...is Damaged or is missing resources"

This may be a problem on my end, but maybe you can provide some insight...

For some reason, these automator actions install and work just fine on every 
machine I've tried them on, except (of course) the one I actually need them to 
run on.  When trying to add either action to an automator workflow, an error 
message pops up, saying something to effect of "This action is either damaged 
or is missing resources", and it refuses to work for me.  The computer in 
question is a Mac Mini running 10.6.4 Snow Leopard.  I have tried 
re-downloading and re-installing the automator actions, but no dice.  
Interestingly, however, when I tried to install v1.0 (just for kicks), it 
installed just fine, and even lets me add it to a workflow, but errors out when 
running the workflow.  Again, v2.0 won't even let me get as far as adding it to 
a workflow.  

I thought maybe the "missing resources" could be something from the optional 
developer tools that come with the OS installer disks... but installing those 
didn't help.  I also thought of possibly testing it all on a new user account 
to see if the current one is just having problems... but that's not really 
helpful in the end, as it really needs to run on the current user account to be 
helpful to me.

Any input on what I might be able to do to make this work on this one stubborn 
computer?   Thanks in advance!

Original issue reported on code.google.com by [email protected] on 30 Aug 2010 at 10:37

Add support for passwords

It would be nice to be able to use passwords for authentication instead of 
requiring SSH public key 
authentication.

Original issue reported on code.google.com by dstebila on 27 Mar 2010 at 3:04

Feature Request: display output / progress of some type once launched?

Hi,

Would it be possible to display a list of "recent servers", filling in the
most recent by default to speed things up if you use the same server
frequently? The functionality is best shown within the "Connect To" dialog
under finder (CMD+K). 

Also, could a small progress "window" (rootless and above others but a
traditional LSUIElement 1 style) that could display the output, or maybe a
progress indicator? 

Thanks

Original issue reported on code.google.com by atr000 on 31 Mar 2010 at 3:23

Add Progress Window

I think it would be really cool to add a feature where a progress window would 
(optionally) open when a file transfer is happening.

Original issue reported on code.google.com by [email protected] on 11 Sep 2010 at 11:26

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.