1

I have configured vsftpd on RHEL7 and i am trying to transfer data to it using lftp from RHEL6.

lftp seems to fail after sending the PASS command for anonymous login.

---> USER anonymous
<--- 331 Please specify the password.
---> PASS xxxxxx
**** gnutls_record_recv: An unexpected TLS packet was received.
---- Closing control socket
cd: Fatal error: gnutls_record_recv: An unexpected TLS packet was received.

The corresponding vsftpd log message:

Wed Mar 18 08:20:41 2020 [pid 37007] FTP command: Client "XX.XXX.XX.XX", "USER anonymous"
Wed Mar 18 08:20:41 2020 [pid 37007] [anonymous] FTP response: Client "XX.XXX.XX.XX", "331 Please specify the password."
Wed Mar 18 08:20:41 2020 [pid 37007] [anonymous] FTP command: Client "XX.XXX.XX.XX", "PASS <password>"
Wed Mar 18 08:20:41 2020 [pid 37006] [cfgdb] OK LOGIN: Client "XX.XXX.XX.XX", anon password "xxxxxx"

But the same lftp works when connecting to a vsftpd configured on RHEL6. vsftpd logs from RHEL6 on successful connection:

Wed Mar 18 06:16:26 2020 [pid 706] FTP command: Client "XX.XXX.XX.XX", "USER anonymous"
Wed Mar 18 06:16:26 2020 [pid 706] [anonymous] FTP response: Client "XX.XXX.XX.XX", "331 Please specify the password."
Wed Mar 18 06:16:26 2020 [pid 706] [anonymous] FTP command: Client "XX.XXX.XX.XX", "PASS <password>"
Wed Mar 18 06:16:26 2020 [pid 703] [cfgdb] OK LOGIN: Client "XX.XXX.XX.XX", anon password "xxxxxx"
Wed Mar 18 06:16:26 2020 [pid 709] [cfgdb] FTP response: Client "XX.XXX.XX.XX", "230 Login successful."

lftp version on RHEL6:

# lftp -v
LFTP | Version 4.0.9 | Copyright (c) 1996-2010 Alexander V. Lukyanov

vsftpd on RHEL7:

# vsftpd -v
vsftpd: version 3.0.2
Fazlin
  • 281
  • 2
  • 10

1 Answers1

1

Managed to find the issue using strace.

When i debugged the vsftpd using strace, there was an error message Cannot change directory.

vsftpd tries to switch to the home directory of the ftp_username and when the directory was missing, the vsftpd failed (though there was no error logged anywhere).

Creating the home directory for ftp_username fixed the issue.

Fazlin
  • 281
  • 2
  • 10