Last week I needed to get a ColdFusion server to read from a SFTP site to list some files. I accomplished this using ColdFusion's built in <cfftp> tag since it also support sftp.
Before you can connect to a sftp site with the <cfftp> tag you first need to get the server fingerprint. The fingerprint is a 16 pair colon separated list of hex numbers which the server returns to identify itself.
The easiest way to get this is use a tool like bitvise to establish a connection to the sftp site. Once the connection is establish you can copy the fingerprint out of the bitvise console log.
Once you have the fingerprint and the credentials, opening the connection is a simple matter of calling the <cfftp> tag with them and specifying the secure flag.
Successful: #cfftp.succeeded#
While we are at it lets list the contents of a directory on the sftp site using the connection we created.
As per Ben Nadel's blog post you need to set both the requesttimeout setting on the page and the "timeout" attribute on the cfftp tag when doing large operations.
Finally we must remember to close the connection we created. Note that if you just specified the credential in the listDir call instead of establishing a connection separately that this step would not be needed.