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:
Password:
 
Google

 SSD VPS Hosting - Vpsie.com
 Mo.nitor.me
 Ivorde forum
 FreeBSD Tutorials
 Linux LVM Commands
 Free Shell Accounts
 FreeBSD Project
 FreeBSD Handbook
 Advanced Bash-Scripting Guide
 The OpenBSD Project
 Distrowatch
 FreeBSD Handbook


Apache Webserver Home Page

Posted on: 07 Dec 2007
Author: mandrei
Section: Server Operating Systems | Problems and Solutions
Views: 1102
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...
Trying 127.0.0.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...
Trying 127.0.0.1...
Connected to localhost.
220 Ivorde FTP !
Name (localhost:root): myuser
331 Password required for myuser
Password:
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
192.168.1.1 - 192.168.1.1:21 masquerading as 192.168.1.1
192.168.1.1 -
192.168.1.1 - Config for www.ivorde.ro:
192.168.1.1 - ServerIdent
192.168.1.1 - DefaultServer
192.168.1.1 - IdentLookups
192.168.1.1 - IdentLookups
(some output)
192.168.1.1 (192.168.25.254[192.168.25.254]) - RequireValidShell
192.168.1.1 (192.168.25.254[192.168.25.254]) - CURRENT-CLIENTS
192.168.1.1 (192.168.25.254[192.168.25.254]) - USER
192.168.1.1 (192.168.25.254[192.168.25.254]) - USER myuser: Login successful.
192.168.1.1 (192.168.25.254[192.168.25.254]) - opening TransferLog '/var/log/proftpd/proftpd-tranfer.log'
192.168.1.1 (192.168.25.254[192.168.25.254]) - Preparing to chroot to directory '/home/www/myuser'
192.168.1.1 (192.168.25.254[192.168.25.254]) - Environment successfully chroot()ed.
192.168.1.1 (192.168.25.254[192.168.25.254]) - unable to chdir to / (Permission denied), defaulting to chroot directory /home/www/myuser
192.168.1.1 (192.168.25.254[192.168.25.254]) - myuser chdir("/"): Permission denied
192.168.1.1 (192.168.25.254[192.168.25.254]) - FTP session closed.
^C192.168.1.1 - ProFTPD terminating (signal 2)
192.168.1.1 - ProFTPD 1.3.1 standalone mode SHUTDOWN
192.168.1.1 - 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:
http://www.khoosys.net/single.htm?ipg=848
http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-SQL.html
http://www.howtoforge.com/proftpd_mysql_virtual_hosting

Bookmarks: Echo "ProFTPd + MySQL - 530 Login incorrect" around:
del.icio.usdiggFurlYahooMyWebGoogleBookmarksFaceBookTechnocratti
-------------------advertising-----------------

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 www.ivorde.ro!

 Post comment:

Name:
Title:
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>
<ol><ul><span><div><br><ins><del>

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 - 9376 views
How to change a user's password in AIX with the output from ECHO command - 8635 views
FreeBSD: Add/remove an additional IP alias - 5609 views
Qmail relay to smarthost: How to route all mail to a smarthost - 3929 views
Print queues in AIX 5L - How to list print queues in AIX - 2884 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


Archives
» 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