[Twisted-Python] ftp server cannot access below directory

seba.tutu seba.tutu at laposte.net
Tue May 31 07:45:49 EDT 2005


Hi,

I was trying to implement a very basic ftp server using the
twisted framework (version 2).

The server is running under WinXP. I launch the programm under
the twisted shell using twistd -y name_program.py 

The client is linux partly because for the test it appears
that  I need a passice connection.

I manage to login and to type basic command (like help, bin)...

As soon as I ask for a ls, there is a message 550 : Cannot
accsees below / directoey : Permission denied. The directory
exists.

If it does not exist there is anyway a very different message
that pops up and the connextion is forced to close.

Obviuosly there is something that I do not get right for the
file systeme authorisation.

I have looked for examples but have not found any helping further.

I you can point me to some usefull links or information I
would greatly appreciate.

Regards.
Sebastien.



The basic code is below.
I use passice client and the connection is OK but I have a
trouble the clie

# FTp server for test

from twisted.internet.protocol import Protocol, ServerFactory
from twisted.protocols import ftp
from twisted.application import service, internet
from twisted.cred import checkers,portal

#To run under the twisted shell: twistd -y name_program.py 

# definition du royaume
realm=ftp.FTPRealm("./seb")

# Attention, il sera necessaire d'utiliser une connection
passive !!!! 
checker=checkers.InMemoryUsernamePasswordDatabaseDontUse()
checker.addUser("q","q")

portal=portal.Portal(realm)
portal.registerChecker(checker)

factory = ftp.FTPFactory(portal)
# definition de l'application
application = service.Application("ftp")

# definition du serveur et attache au service associe !!!
myServer=internet.TCPServer(21, factory)
myServer.setServiceParent(application)



Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)







More information about the Twisted-Python mailing list