giampaolo / pyftpdlib

Extremely fast and scalable Python FTP server library
MIT License
1.65k stars 265 forks source link

Got 530 Authentication failed with tutorial sample #599

Closed t-walker-wei closed 1 year ago

t-walker-wei commented 1 year ago

I stuck in the simple sample, help me please. Thank you first. I just copy and run the sample from a-base-ftp-server I got the 530 Authentication failed error when login with user name and password in FileZilla. But it ok when I login with anonymous user. I don't know what is wrong with this.

OS: Windows10 Python vertion: 3.10.10 pyftpdlib: 1.5.7

Here is the log

[I 2023-03-31 00:52:58] concurrency model: async
[I 2023-03-31 00:52:58] masquerade (NAT) address: None
[I 2023-03-31 00:52:58] passive ports: None
[D 2023-03-31 00:52:58] poller: 'pyftpdlib.ioloop.Select'
[D 2023-03-31 00:52:58] authorizer: 'pyftpdlib.authorizers.DummyAuthorizer'
[D 2023-03-31 00:52:58] handler: 'pyftpdlib.handlers.type'
[D 2023-03-31 00:52:58] max connections: 512
[D 2023-03-31 00:52:58] max connections per ip: unlimited
[D 2023-03-31 00:52:58] timeout: 300
[D 2023-03-31 00:52:58] banner: 'pyftpdlib 1.5.7 ready.'
[D 2023-03-31 00:52:58] max login attempts: 3
[I 2023-03-31 00:52:58] >>> starting FTP server on 0.0.0.0:2121, pid=17404 <<<
[I 2023-03-31 00:53:34] 192.168.0.104:58186-[] FTP session opened (connect)
[D 2023-03-31 00:53:34] 192.168.0.104:58186-[] -> 220 pyftpdlib 1.5.7 ready.
[D 2023-03-31 00:53:34] 192.168.0.104:58186-[] <- USER user
[D 2023-03-31 00:53:34] 192.168.0.104:58186-[] -> 331 Username ok, send password.
[D 2023-03-31 00:53:34] 192.168.0.104:58186-[user] <- PASS ******
[D 2023-03-31 00:53:38] 192.168.0.104:58186-[] -> 530 Authentication failed.
[I 2023-03-31 00:53:38] 192.168.0.104:58186-[] USER 'user' failed login.
[D 2023-03-31 00:53:38] [debug] call: close() (<FTPHandler(id=1975293646816, addr='192.168.0.104:58186')>)
[I 2023-03-31 00:53:38] 192.168.0.104:58186-[] FTP session closed (disconnect).
[I 2023-03-31 00:53:46] 192.168.0.104:58188-[] FTP session opened (connect)
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[] -> 220 pyftpdlib 1.5.7 ready.
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[] <- USER anonymous
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[] -> 331 Username ok, send password.
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] <- PASS ******
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 230 Login successful.
[I 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] USER 'anonymous' logged in.
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] <- SYST
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 215 UNIX Type: L8
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] <- FEAT
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 211 End FEAT.
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] <- OPTS UTF8 ON
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 501 Invalid argument.
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] <- PWD
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 257 "/" is the current directory.
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] <- TYPE I
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 200 Type set to: Binary.
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] <- PORT 192,168,0,104,227,77
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 200 Active data connection established.
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] <- MLSD
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 125 Data connection already open. Transfer starting.
[D 2023-03-31 00:53:46] [debug] starting transfer using send() (<DTPHandler(id=1975293646816, addr='192.168.0.104:58188', user='anonymous')>)
[D 2023-03-31 00:53:46] [debug] call: close() (<DTPHandler(id=1975293646816, addr='192.168.0.104:58188', user='anonymous')>)
[D 2023-03-31 00:53:46] 192.168.0.104:58188-[anonymous] -> 226 Transfer complete.
giampaolo commented 1 year ago

I just copied & pasted the code from the doc and used user / 12345 as user / password pair and everything is fine:

~/svn/pyftpdlib {master}$ ftp 127.0.0.1 2121
Connected to 127.0.0.1.
220 pyftpdlib based ftpd ready.
Name (127.0.0.1:giampaolo): user
331 Username ok, send password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 

530 Authentication failed. means you entered the wrong password.