Configuring WebSphere Partner Gateway V6.2 to send and receive files using SFTP

Configuring the new SSH File Transfer Protocol (SFTP) support in WebSphere Partner Gateway V6.2 can be a challenge. This article walks you through steps to configure V6.2 to send and receive files using SFTP.

Dave Mulley (dmulley@us.ibm.com), IT Specialist, EMC

Dave Mulley is an IT Specialist and a member of the IBM Software Services for WebSphere Enablement team based in Raleigh, North Carolina. Dave is focused on the WebSphere Business Integration family of products and has worked for IBM since 1999. You can reach Dave at dmulley@us.ibm.com


developerWorks Professional author
        level

02 June 2010

Also available in Chinese

Prerequisites

Installing freeSSHd

After you have downloaded freeSSHd, complete the following steps to install it:

  1. Start the freeSSHd installer: Double-click on freeSSHd.exe.
  2. When the "Welcome to the freeSSHd SSH/Telnet Server Setup Wizard" dialog is displayed, click Next.
  3. When the "Select Destination Location" dialog is displayed, change the installation location to C:\freeSSHd and click Next.
  4. When the "Select Components" dialog is displayed, ensure that Full Installation is selected and click Next.
  5. When the "Select Start Menu Folder" dialog is displayed, click Next.
  6. When the "Select Additional Tasks" dialog is displayed, click Next.
  7. When the "Ready to Install" dialog is displayed, click Next.
  8. When the "Try Other WeOnlyDo.com Products" dialog is displayed, click Close.
  9. When the "Private keys should be created. Should I do it now?" dialog is displayed, click Yes.
  10. When the "Do you want to run FreeSSHd as a system service?" dialog is displayed, click No.
  11. When the "Completing the freeSSHd SSH/Telnet Server Setup Wizard" dialog is displayed, click Finish.

Installing PuttyGen

PuttyGen is downloaded from the Web site in binary form and does not require installation -- simply copy it to the WebSphere Partner Gateway machine.

Creating the FTP directory structure

Follow the steps below to create the directory structure required for this article:

  1. Create a new c:\ftproot folder
  2. Create a new c:\ftproot\fromWPG folder to be used by the WebSphere Partner Gateway Destination
  3. Create a new c:\ftproot\toWPG folder to be polled by the WebSphere Partner Gateway Receiver

Creating the public and private keys

Here are the steps to create the openSSH format public and private keys using PuttyGen:

  1. Start PuttyGen.
  2. When the Putty Key Generator screen appears, click Generate to begin generating the new public/private key pair:
    Generate new public/private key pair
    Generate new public/private key pair
  3. Move the mouse around the highlighted area until the progress bar is full to generate the key:
    Create a passphrase
    Create a passphrase
  4. Once the public/private key pair has been generated, enter a passphrase such as passw0rd:
    Generate new public/private key pair
    Generate new public/private key pair
  5. Select the entire contents of the public key to paste into the OpenSSH authorized_keys file box, then right-click and select Copy:
    Select the public key
    Select the public key
  6. Open a new document in Notepad and paste the public key into it. The key should be on a single line and start with ssh-rsa:
    New Notepad document
    New Notepad document
  7. Save the public key to a file that has the same name as the user (userkey) that is configured in freeSSHd (it will be created below) with no extension in the freeSSHd installation directory. In this case, save the file as c:\freesshd\userkey (you may have to manually rename the file to remove the extension):
    Save the public key
    Save the public key
  8. Save the private key in the OpenSSH format: Select Conversions => Export OpenSSH key from the PuttyGen menu bar:
    Export the private key
    Export the private key
  9. Save the file as c:\userkeyprivate:
    Save the private key
    Save the private key
  10. Close PuttyGen.

Configuring freeSSHd

This section shows you how to configure the freeSSHd server and create two new users:

  1. Start freeSSHd using the Windows Start menu: Select Programs => freeSSHd => freeSSHd.
  2. When the "Thank you for using freeSSHd" dialog is displayed, click OK.
  3. Double-click on the freeSSHd icon on the Task bar to start the freeSSHd Settings application:
    Open freeSSHd settings
    Open freeSSHd settings
  4. When the freeSSHd Settings application is displayed, click on the Authentication tab.
  5. Validate the following fields:
    Public key folderC:\freeSSHd\
    Password authenticationAllowed
    Public key authenticationAllowed
  6. If any changes were made, click Apply.
  7. Click on the SFTP tab.
  8. Change the SFTP home path to C:\ftproot and click Apply.
  9. Click on the Users tab.
  10. Click Add and enter the following values:
    Loginuserhash
    AuthorizationPassword stored as SHA1 hash
    Passwordpassw0rd
    Password (again)passw0rd
    User can useSFTP
    userhash User Settings
    userhash User Settings
  11. Click OK.
  12. When you are returned to the Users tab, click Add and enter the following values:
    Loginuserkey
    AuthorizationPublic key (SSH only)
    User can useSFTP
  13. Click OK.
  14. When you are returned to the Users tab, click Apply.
  15. Click on the Logging tab.
  16. Select Log Events and click Apply.
  17. Click OK to exit the freeSSHd Settings application.
  18. Stop freeSSHd: right-click on the freeSSHd icon on the Task bar and select Unload.
  19. Start freeSSHd using the Windows Start menu: Select Programs => freeSSHd => freeSSHd.
  20. Double-click on the freeSSHd icon on the task bar to start the freeSSHd Settings application.
  21. Validate that the configuration changes you made to the Authentication, SFTP, Users, and Logging tabs have been persisted.

Creating a WebSphere Partner Gateway receiver (password)

This section shows you how to configure the WebSphere Partner Gateway SFTP receiver for a user that is authenticated using a password (hash):

  1. Create a new receiver: Select Hub Admin => Receivers => Create.
  2. Enter a receiver name (SFTP).
  3. Select SFTP from the Transport Type drop-down.
  4. Enter the following values:
    Operation ModeProduction
    SFTP Host IP / Host Name127.0.0.1
    Port Number22
    Remote Event Directory/toWPG
    Authentication TypeUser Name / Password
    User Iduserhas
    Passwordpassw0rd
    SFTP receiver configuration
    SFTP receiver configuration
  5. Click Save.
  6. Before using this receiver, restart the WebSphere Application Server that hosts the WebSphere Partner Gateway receiver application.
  7. After the WebSphere Partner Gateway receiver has been restarted, this SFTP receiver will be ready to receive files from the SFTP server.

Creating a WebSphere Partner Gateway destination (private key)

This section shows you how to configure the WebSphere Partner Gateway SFTP destination for a user that is authenticated using a private key:

  1. Create a new destination for an external partner.
  2. Enter a destination name (SFTP)
  3. Select SFTP from the Transport Type drop-down.
  4. Enter the following values:
    SFTP Host IP / Host Name127.0.0.1
    Port Number22
    Remote Event Directory/fromWPG
    Authentication TypePrivate Key
    Private Key Filec:/userkeyprivate
    Pass Phrasepassw0rd
    SFTP destination configuration
    SFTP destination configuration
  5. Click Save.
  6. Before using this destination, update the connection and restart the WebSphere Application Server that hosts the WebSphere Partner Gateway Document Manager application.
  7. Once the WebSphere Partner Gateway Document Manager has been restarted, this SFTP destination is ready for testing.

Download

DescriptionNameSize
Code sampleSFTPwithWPG.zip687 KB

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Business process management on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Business process management, WebSphere, Industries
ArticleID=494150
ArticleTitle=Configuring WebSphere Partner Gateway V6.2 to send and receive files using SFTP
publish-date=06022010