FTP "Got reply 1004 to the command 1" if remote banner has an embedded carriage return

Advertisement

wwarren
Joined:
Posts:
1

FTP "Got reply 1004 to the command 1" if remote banner has an embedded carriage return

This was a puzzling one, since FTP from Windows command prompt worked, but not WinSCP FTP.
Environment
PC: WinSCP 5.7.7
Server: RHEL 6.7 with vsftpd-2.2.2-24.el6.x86_64

Descripton
If the remote FTP banner (vsftpd.conf ftpd_banner option) has an embedded carriage return (^M), the WinSCP login will fail with
Got reply 1004 to the command 1
Remove the carriage return, and everything is fine!

Logging level 2 excerpt
. 2022-05-17 15:16:51.798 Connected with <redacted>. Waiting for welcome message...
< 2022-05-17 15:16:51.798 220 This server is the property of <redacted>.
< 2022-05-17 15:16:51.798 Unauthorized access is prohibited.
> 2022-05-17 15:16:51.798 USER <redacted>
. 2022-05-17 15:16:51.798 Connection failed.
. 2022-05-17 15:16:51.798 Got reply 1004 to the command 1
* 2022-05-17 15:16:51.848 (EFatal) Connection failed.
* 2022-05-17 15:16:51.848 Connection failed. 

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,392
Location:
Prague, Czechia

Re: FTP "Got reply 1004 to the command 1" if remote banner has an embedded carriage return

If the server responded like this:
220 This server is the property of <redacted>.
Unauthorized access is prohibited.
then it is indeed a violation of FTP specification.

Admittedly, WinSCP should provide better feedback.

Reply with quote

Advertisement

You can post new topics in this forum