Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

530 “User cannot log in” on Microsoft FTP Server (works in FileZilla) #261

Open
Mat40 opened this issue Jan 8, 2025 · 0 comments
Open

Comments

@Mat40
Copy link

Mat40 commented Jan 8, 2025

Describe the bug
I’m encountering a 530 User cannot log in error when attempting to connect to a Microsoft FTP server using basic-ftp in Node.js. I’ve confirmed that the credentials and the IP address are correct, and I can successfully connect via FileZilla from the same IP with the same credentials. The server does not use TLS, so I’m connecting with secure: false.

Example code

const ftp = require("basic-ftp")

async function test() {
    const client = new ftp.Client()
    client.ftp.verbose = true
    
    try {
        await client.access({
            host: "192.168.65.89",
            user: "ftpuser",
            password: "PassWord=",
            port: 21,
            secure: false // No TLS
        })
        console.log("Connection successful!")
        console.log(await client.list())
        
    } catch(err) {
        console.error("FTP error:", err)
    } finally {
        client.close()
    }
}

test()

Console output

Connected to 192.168.65.89:21 (No encryption)
< 220 Microsoft FTP Service

> OPTS UTF8 ON
< 200 OPTS UTF8 command successful - UTF8 encoding now ON.

Login security: No encryption
> USER ftpuser
< 331 Password required

> PASS ###
< 530 User cannot log in.

Erreur FTP: FTPError: 530 User cannot log in.
    at FTPContext._onControlSocketData (...\basic-ftp\dist\FtpContext.js:283:39)
    at Socket.<anonymous> (...\basic-ftp\dist\FtpContext.js:127:44)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  code: 530
}
> QUIT

Which version of Node.js are you using?
Node.js v21.5.0

Which version of basic-ftp are you using?
basic-ftp v5.0.5

Additional context

  • The same credentials from the same IP work correctly when using FileZilla.
  • The FTP server is a Microsoft FTP Service and does not use TLS (secure: false is set).
  • The connection fails with a 530 User cannot log in despite matching credentials.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant