FreeBSD - Tutorials, Security
Home   Archives   Sitemap   About   Contact

ProFTPd + MySQL - 530 Login incorrect

Home NEW! Unix Forum News 100 Tips and Tricks Website Development Server Operating Systems Databases
 Ivorde.ROarrow Server Operating Systems arrowProblems and SolutionsarrowProFTPd + MySQL - 530 Login incorrect 

Article Sections

    Hello, Guest !
User name:

 SSD VPS Hosting -
 Ivorde forum
 FreeBSD Tutorials
 Linux LVM Commands
 Free Shell Accounts
 FreeBSD Project
 FreeBSD Handbook
 Advanced Bash-Scripting Guide
 The OpenBSD Project
 FreeBSD Handbook

Apache Webserver Home Page

Posted on: 07 Dec 2007
Author: mandrei
Section: Server Operating Systems | Problems and Solutions
Views: 5015
Comments: 1 (Add)

ProFTPd + MySQL - 530 Login incorrect
Deploying a FTP server using ProFTPd and MySQL is quite simple. Debugging it is a little harder :)


I wanted to move my proftpd+mysql server from old box to new box (not dump-restore cause binaries are compiled for different cpus and I really don't need the headakes).
These are the steps I followed:

1. Install proftpd and mysql50-server on new box

On new box I installed proftpd and mysql-server from ports (/usr/ports/ftp/proftpd and /usr/ports/databases/mysql50-server and the make install clean)

And copy proftpd config file (/usr/local/etc/proftpd.conf) from old server to new one.

2. Backup mysql database (called proftp) from old box and restore it to new box

Read How to copy a mysql database using mysqldump on for more instructions how to create the mysql database backup and use scp/rsync to copy it from one server to another (new one to old one).

3. Start ProFTPd

$ /usr/local/etc/rc.d/proftpd start

then ftp to localhost and test:

$ ftp localhost
[root@www ~]# ftp localhost
Trying ::1...
Connected to localhost.
421 Service not available, remote server has closed connection.
ftp> ^D

At this time I was convinced that there was something really not working with either my proftpd config file, either mysql database which contains proftp tables.

$ truss /usr/local/etc/rc.d/proftpd start
(lots of output)

Seems that proftpd cannot connect to the mysql database. I then remember that I had to grant access to proftpd database to the user that proftpd uses to connect:

mysql> GRANT ALL PRIVILEGES ON proftpd.* to 'ftp'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

(or see Adding new user accounts to MySQL )

$ ftp localhost
Trying ::1...
Connected to localhost.
220 Ivorde FTP !
Name (localhost:root): myuser
331 Password required for myuser
530 Login incorrect.
ftp: Login failed.
ftp> ^D
421 Service not available, remote server has closed connection.

So now mysql authentification for proftpd works but it seems that I cannot ftp login with myuser.

Debugging your proftpd server is something that came very usefull for me. See Debugging ProFTP

To start debugging proftpd, issue the following command:

$ proftpd -nd6
- mod_tls/2.1.2: using OpenSSL 0.9.8g 19 Oct 2007 - masquerading as - - Config for - ServerIdent - DefaultServer - IdentLookups - IdentLookups
(some output) ([]) - RequireValidShell ([]) - CURRENT-CLIENTS ([]) - USER ([]) - USER myuser: Login successful. ([]) - opening TransferLog '/var/log/proftpd/proftpd-tranfer.log' ([]) - Preparing to chroot to directory '/home/www/myuser' ([]) - Environment successfully chroot()ed. ([]) - unable to chdir to / (Permission denied), defaulting to chroot directory /home/www/myuser ([]) - myuser chdir("/"): Permission denied ([]) - FTP session closed.
^C192.168.1.1 - ProFTPD terminating (signal 2) - ProFTPD 1.3.1 standalone mode SHUTDOWN - deleting existing scoreboard '/var/run/proftpd.scoreboard'

The last 20-30 lines are crucial. They're telling me that the permissions on home directory of the user myuser that I'm trying to login with are wrong (umask is 027 so proftpd was unable to even read the home dir).

I fixed this problem and proftpd+mysql is migrated and ready for, let's say, production :).
See following How-TOs for deploying a ProFTPd + MySQL server:

Bookmarks: Echo "ProFTPd + MySQL - 530 Login incorrect" around:

Other articles in Server Operating Systems / Problems and Solutions
» How to change Environment Variable $MAIL on FreeBSD box
» How to remove first/last character from a string using SED
» How to allow access to su to root on FreeBSD
» Packet Filter broken on FreeBSD 6.2 ? Unusual pf error
» Creating/Adding (temporary) users on FreeBSD 6

Contact webmaster regarding this article
Register or Login to post your article
Hello, Guest ! You can Login or Register to!

 Post comment:

Please type the word you see in the image (anti-spam verification). Refresh the page if you don't understand the word.
Allowed HTML Tags for comments:<p><strong><em><u><h1><h2><h3><h4><h5><h6><img><li>

1 comment(s) to ProFTPd + MySQL - 530 Login incorrect:

1. Re: ProFTPd + MySQL - 530 Login incorrect
Before starting proftpd in debug mode by mandrei at December 07th, 2007 - 08:45
You need to stop your proftpd before starting it in debug mode or else proftpd -nd6 will display some error regarding binding to port 21 (because port 21 is already taken by proftpd standard) and will be of no help.

   Latest topics on the forum:
   Most viewed articles:
How to copy a mysql database using mysqldump - 19483 views
FreeBSD: Add/remove an additional IP alias - 16375 views
How to change a user's password in AIX with the output from ECHO command - 15498 views
Qmail relay to smarthost: How to route all mail to a smarthost - 10595 views
How to start/enable telnet on a FreeBSD server - 9231 views

   Latest 10 articles:
Qmail relay to smarthost: How to route all mail to a smarthost - 03 Feb 2009
EXIM 4 relay to smarthost: How to route all mail except local domain - 03 Feb 2009
Windows XP: print LISTEN ports and network connections using netstat - 30 Jan 2009
How to cut out first last n characters from each file name, from a filelist - 04 Nov 2008
Mozilla Firefox3 is now released - 18 Jun 2008
How to switch lower case to upper case and upper case to lower case in a string - 17 Jun 2008
How to rename files/directories to uppercase/lowercase character names - 17 Jun 2008
How to convert lower case to upper case letters in a shell script/command - 17 Jun 2008
Unix,Linux,FreeBSD - How to rename a list of files, replacing spaces inside their names - 12 Jun 2008
How to change a user's password in AIX with the output from ECHO command - 21 May 2008

» 2007  |  June  |  October  |  November  |  December
» 2008  |  January  |  February  |  March  |  April  |  May  |  June  |  November
» 2009  |  January  |  February

Home | Archives | Sitemap | About | Contact

Designed and developed by Andrei Manescu. Optimized for Mozilla Firefox.  
Copyright 2007 Andrei Manescu
All trademarks and copyrights on this page are owned by their respective owners. Comments are owned by those who posted them.
Valid W3 Document Valid XHTML 1.0 Transitional Valid CSS! The FreeBSD Project Viewable With Any Browser