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
&nbsp; import FTPFactory<br>from twisted.protocols.ftp&nbsp; import FTPRealm <br>from twisted.cred.portal&nbsp;&nbsp;&nbsp; import Portal<br><br>print &quot;Starting FTP server&quot;<br><br>p = Portal(FTPRealm('./'))&nbsp;&nbsp; # 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 &quot;FTP Server terminated.&quot;<br><br>===============<br><br>Simple. This raises no exceptions, and appears to be working until I actually log in.
<br><br>===============<br><br>ftp&gt; 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 &quot;real&quot; users)<br><br><br>-- <br>&quot;Ladies and gentlemen, there's nothing to worry about ... but please keep your heads down.&quot;
<br><br>Best,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Jeff<br>