Mac OS X Server v10.5 and v10.6: Apple FTP Server supports IPv4 connections

Products Affected

Mac OS X Server 10.5, Mac OS X Server 10.6

Symptoms

The Apple FTP server in Mac OS X Server v10.5 and v10.6 can accept both IPv4 and IPv6 connections. However, when an IPv6 connection is made, issuing commands such as ls or cd in the ftp session will produce these (or similar) alerts:

502 'LPSV': command not understood.
502 'LPRT' 6,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,2,168,192': command not understood.
425 Can't build data connection: Address family not supported by protocol family.

This may also occur when using "localhost" to initiate an ftp session (ftp username@localhost) on the ftp server itself, even if IPv6 has been disabled on Network interfaces.

Resolution

Execute the following Terminal command to ensure the Apple FTP server only accepts IPv4 connections:

sudo /usr/libexec/PlistBuddy -c "add :Sockets:Listeners:SockFamily string IPv4" /System/Library/LaunchDaemons/xftpd.plist

The change takes effect the next time FTP Service is started or restarted.

Not helpful Somewhat helpful Helpful Very helpful Solved my problem