This is the forth and final post in the series "SFTP Adapter - Installing SFTP Server on Windows". If you have not read the previous posts, you can refer the below links.
SFTP Adapter - Installing SFTP Server on Windows - Part 01
SFTP Adapter - Installing SFTP Server on Windows - Part 02
SFTP Adapter - Installing SFTP Server on Windows - Part 03
This post describes the steps to test the localhost SFTP server using private key based authentication feature which available in SFTP Adapter which is a part of Secure Connectivity add-on.
- Navigate to http://localhost:50000/nwa/key-storage
- Create a view called "SFTP_KEY"
- Click on "Create" which is under "View Entries" Tab
- Provide the Entry Name (e.g. mykey)
- Select the "Store Certificate" option
- Click on "Next"
- Provide the common name (e.g. mykey)
- Click on "Finish"
- Select the certificate entry (e.g. mykey-cert)
- Click on "Export Entry"
- Choose "Base 64 x.509"
- Click on "Download" link
- Save the certificate in the user's home directory
- Open the ssh console by using the steps mentioned in SFTP Adapter - Installing SFTP Server on Windows - Part 02
- Convert the SSL keys into SSH keys using openSSL utility
- $ openssl x509 -in mykey.cert -noout -pubkey > mykey.pkey
- Convert the SSH key into OpenSSH key format using ssh-keygen utility
- $ ssh-keygen -i -m PKCS8 -f mykey.pkey > mykey.ssh.pkey
- Add/Append the content of the OpenSSH key to "~/.ssh/authrorized_keys" file
- $ cat mykey.ssh.pkey > .ssh/authorized_keys
- Verify the read access
- Modify the SFTP sender channel configuration to use the above created private key
- Activate & Start the channel. The channel short logs should look like below
The above logs shows that it can able to successfully connect to the SFTP server using the configured private key and downloaded the file.
That's end the series. Cheers