[Twisted-Python] Filed to receive directory listing after successful login in FTPFactory

Malhar Vora malhar.vora at clogeny.com
Tue May 26 00:30:56 MDT 2015


Hi Guys,

I have following code.

-------------------------------------------------------------


from twisted.protocols.ftp import FTPFactory, FTPRealm, FTPShell
from twisted.cred.portal import Portal
from twisted.cred.checkers import AllowAnonymousAccess, FilePasswordDB
from twisted.internet import reactor
from twisted.cred.checkers import
InMemoryUsernamePasswordDatabaseDontUse as InMemoryDB
from twisted.python import log
from twisted.cred.credentials import UsernamePassword


import sys

users = {
    "user": "password"
}

im_memory_db_checker = InMemoryDB(**users)

p = Portal(FTPRealm('./'),
           (
               AllowAnonymousAccess(),
               im_memory_db_checker,
            )
          )

f = FTPFactory(p)

log.startLogging(sys.stdout)
reactor.listenTCP(21, f)
reactor.run()

-------------------------------------------------------------

While running above code, when I enter wrong credentials in my
FileZilla, it returns directory listing successfully but when I login
successfully it says :

*Failed to Response: 550 []: No such file or directory.
Error:	Failed to retrieve directory listing*

I have got this script from examples given on twisted site.

What am I missing ?, Please guide me.


Thank you,


-- 

*Regards,*
Malhar Vora
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20150526/c1404d58/attachment.html>


More information about the Twisted-Python mailing list