CFSSH (Secure FTP) In Lucee

We have been migrating a lot of scheduled tasks from an old ColdFusion server to Lucee. A coworker recently asked me for help because they noticed that one particular task which used CFFTP was failing. Apparently Lucee doesn't natively support the 'secure' attribute of CFFTP.

My co-worked had done some research and found CFSSH but was having some issues getting it to work.

There are a few old forum posts that mention this tag but they seem a bit outdated. Not sure if the tag or Lucee (Railo) changed but I thought I'd post what I did here for reference. Note I am doing this on Windows with a recent Lucee install. You may need to tweak paths if you are on Railo or a different OS.

  1. Download ZIP from Github:
  2. Unzip
  3. Copy the \cfssh-master\cfssh-master\src\cfssh\tag\cfssh to the following directory C:\inetpub\wwwroot\railo\WEB-INF\lucee\customtags
  4. Restart Lucee

Previous posts mentioned copying things to \WEB-INF\lucee\library\tag but when I did that Lucee threw an error and reading the error it seemed the only place it was looking for custom tags is in the /customtags folder.

Previous examples also referred to calling the tag via

<cfssh .... />

Which also threw an error. I found some old Railo posts that mentioned the correct way was to prefix the tag with CF_:

<cf_ssh .... />

Which worked!

<cf_ssh action="listdir"

Digging into the source I found the following methods: