If you find that your FTP sessions are unable to transfer data after an i 6.1 or 7.1 OS upgrade, the problem may be in the way IBM changed FTP sessions for i 6.1 and above.
Starting with the IBM i 6.1 operating system and above (including i 7.1), IBM changed all FTP client attempts to send and receive data in Extended Passive Mode. This is a change from the default sending mode in i5/OS V5R4M0 and below.
What happens then is that after an i 6.1 or 7.1 operating system upgrade, you may see messages similar to the following during an FTP transfer and your sessions may fail to complete:
- 500 ‘EPSV’: command not understood.
- Unable to setup for an active data connection to the server, reason code 1
- Use of EPSV disabled for this server session.
You may also receive an FTP550 error (Access Denied, Permission Denied, etc) and your session won’t be able to send or receive.
If you see these messages and your FTP session doesn’t complete, add the following FTP sub-command to your FTP script, immediately after the USER sub-command where your FTP session connects to the remote server.
SENDEPSV 0 sub-command turns off Extended Passive Mode sending for your IBM i FTP session.
This happened in my shop right after we upgraded a V5R4M0 box to i 6.1. Adding the SENDEPSV 0 command to our script solved the problem.
The issue is that the FTP server you’re talking to may not support Extended Passive Mode and that can cause a failure. Adding SENDEPSV o to your script will probably solve the issue.
This is also referenced in the System i – i5/OS Memo to Users Version 6 Release 1 (May 2011 update) publication.
Originally posted July 25, 2012. Reposted and updated March 3, 2014 to modify how to call the SENDEPSV 0 command
Thanks to Richard Downer for telling me about adding the ‘0’ parameter to the SENDEPSV FTP sub-command, in order to always force FTP Extendeed passive Mode off..