For no good reason, I've been trying to implement a basic FTP server w/ Twisted 2.2. After a few puzzling exceptions, some custom code, TOSSING the custom code, and more quality time with the source, I've come to the conclusion that I need a nudge in the right direction.
<br clear="all"><br>Initially, it looks like it should be pretty straightforward (as much as it ever gets in Twisted anyway :), but it's not working. Here's the code:<br><br>===============<br><br>from twisted.protocols.ftp
import FTPFactory<br>from twisted.protocols.ftp import FTPRealm <br>from twisted.cred.portal import Portal<br><br>print "Starting FTP server"<br><br>p = Portal(FTPRealm('./')) # start up in local dir for giggles
<br>f = FTPFactory(p)<br><br>from twisted.internet import reactor<br>reactor.listenTCP(21, f)<br>reactor.run()<br>print "FTP Server terminated."<br><br>===============<br><br>Simple. This raises no exceptions, and appears to be working until I actually log in.
<br><br>===============<br><br>ftp> open localhost<br>Connected to elric.<br>220 Twisted 2.2.0 FTP Server<br>User (elric:(none)): anonymous<br>331 Guest login ok, type your email address as password.<br>Password:<br>530 Sorry, Authentication failed.
<br>Login failed.<br><br>===============<br>
<br>
The shell it's running from shows no errors or exceptions. So why did my anonymous login fail?<br><br>(I'll wait until I solve that before I tackle the issue of actual "real" users)<br><br><br>-- <br>"Ladies and gentlemen, there's nothing to worry about ... but please keep your heads down."
<br><br>Best,<br><br> Jeff<br>