Monday, November 12, 2007

Use PuTTY, PSFTP, Pageant, Create SendTo

The intended result: Create a seamless right-click SendTo for a S/FTP using putty.

The Steps:
  1. Get the complete installer for PuTTY here. And install it.
  2. Use PuTTYgen and generate a public and private key.
  3. Select and copy all the stuff in the Public key box and open up a PuTTY/SSH connection to your destination site.
  4. If it doesn't exist, mkdir .ssh ; chmod 700 .ssh ; cd .ssh
  5. If it doesn't exist, create the file authorized_keys and make its permissions 644: chmod 644 authorized_keys
  6. Edit, such as with vi the authorized_keys file and insert/paste the stuff copied before. Save and exit.
  7. Save the private key file (still within PuTTYgen) somewhere convenient. It's up to you if you wish to specify a password on the private key. Obviously, it's more secure if you do, but it may be more of a pain.
  8. Start Pageant in a manner such as: c:\program files\PuTTY\Pageant.exe c:\path\to\private.ppk If you have a password on the private key, this is the time to input it. After Pageant runs, the key is loaded. You shouldn't need to worry about inputting the private key password again while Pageant runs. If you don't want to use Pageant, then you can choose to include the .ppk file in the SSH\Auth\Private key file for authentication box.
  9. Create and save a PuTTY profile for your S/FTP destination. Along with Basic options (Host Name, Port, and (*)SSH), click Connection->Data and put your user name (!Important!). In SSH, make certain the preferred SSH version is 2. These are minimum settings. Go back to Session after making these changes, and click [Save].
  10. Test your connection. If you've followed all these instructions so far, you should be able to double-click the Saved Session and get to your prompt on your remote machine without a password!
  11. --- The Good Stuff --- Create a batch file sftpit.bat ... It should look similar to :
    @echo put %1 | "c:\program files\PuTTY\psftp" -load YourPuTTYSessionName -batch
  12. Click Start, Run, type in SendTo and Press [Enter]/Click [OK]
  13. Right-Click, New=>Shortcut and browse to the sftpit.bat. [Next]
  14. Give it some relevant name [Finish]
  15. Right-click a file, SendTo=>this shortcut.

No comments:

Blog Archive