LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 11-23-2008, 03:57 PM   #1
delite
Member
 
Registered: Nov 2008
Posts: 44

Rep: Reputation: 15
proftpd + mysql


Hi,

I installing proftpd for the first time and i've opted to go for mysql authentication.

I'm working locally on fedora 8 and I yummed like this:
Code:
# yum install proftpd proftpd-mysql
No dependencies were required and I already have mysql installed. Also i'm using yum packages for ease of updating remotely.

Next I set up some mysql stuff (names have been changed to protect the innocent!):
Code:
CREATE DATABASE db;
GRANT ALL ON db.* TO user@localhost IDENTIFIED BY "password";

mysql db -u user -p


CREATE TABLE users (
	userid VARCHAR(30) NOT NULL UNIQUE,
	passwd VARCHAR(80) NOT NULL,
	uid INTEGER UNIQUE,
	gid INTEGER,
	homedir VARCHAR(255),
	shell VARCHAR(255) );

CREATE TABLE groups (
	groupname VARCHAR(30) NOT NULL,
	gid INTEGER NOT NULL,
	members VARCHAR(255) );


PASSWORD()
INSERT INTO users VALUES ( 'admin', 'password', 1001, 1001, '/var/www/html', NULL);
INSERT INTO users VALUES ( 'joe', PASSWORD('password'), 1002, 1002, '/var/www/html', NULL);

INSERT INTO groups VALUES ( 'temp', 1001, 'admin');
This is what my configuration file looks like:
Code:
ServerName			"ProFTPD server"
ServerIdent			on "FTP Server ready."
ServerAdmin			root@localhost
ServerType			standalone
DefaultServer			on
AccessGrantMsg			"User %u logged in."
DeferWelcome			off

# Use this to excude users from the chroot
DefaultRoot			~ !adm

# Use pam to authenticate (default) and be authoritative
#AuthPAMConfig			proftpd
AuthOrder			mod_auth_pam.c* mod_auth_unix.c

# Do not perform ident nor DNS lookups (hangs when the port is filtered)
IdentLookups			off
UseReverseDNS			off

# Port 21 is the standard FTP port.
Port				21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask				022

# Default to show dot files in directory listings
ListOptions			"-a"

# Allow to resume not only the downloads but the uploads too
AllowRetrieveRestart		on
AllowStoreRestart		on

# To prevent DoS attacks
MaxInstances			20

# Set the user and group that the server normally runs at.
User				nobody
Group				nobody

# Disable sendfile by default since it breaks displaying the download speeds in
# ftptop and ftpwho
UseSendfile			no

# This is where we want to put the pid file
ScoreboardFile			/var/run/proftpd.score

# Normally, we want users to do a few things.
<Global>
  AllowOverwrite		yes
  <Limit ALL SITE_CHMOD>
    AllowAll
  </Limit>
</Global>

# Define the log formats
LogFormat			default	"%h %l %u %t \"%r\" %s %b"
LogFormat			auth	"%v [%P] %h %t \"%r\" %s"

# SQL authentication Dynamic Shared Object (DSO) loading
# See README.DSO and howto/DSO.html for more details.
<IfModule mod_dso.c>
   LoadModule mod_sql.c
   LoadModule mod_sql_mysql.c
#   LoadModule mod_sql_postgres.c
</IfModule>

SQLConnectInfo			db@localhost user password
SQLAuthenticate			users*
SQLAuthTypes			Plaintext Backend Empty

SQLUserInfo			users userid passwd uid gid homedir shell
SQLGroupInfo			groups groupname gid members 

RequireValidShell		off

PidFile		/var/run/proftpd.pid
Firewall is set to allow ftp and SELinux is set to permissive (no warnings though).

When I attempt to ftp from console I get the message:
Code:
530 Login incorrect.
I set numerous ways for authentication, so the passwords should be ok.


Where am I going wrong?
How do I check that proftpd is talking with mysql ok?


CHEERS!


P.S. Since i'm using standalone mode i'm starting and exiting using:
Code:
# /usr/sbin/proftpd
# kill -TERM `cat /var/run/proftpd.pid`
 
Old 11-24-2008, 02:01 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,772

Rep: Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294Reputation: 1294
Try changing
Quote:
AuthOrder mod_auth_pam.c* mod_auth_unix.c
to
Code:
AuthOrder	mod_sql.c mod_auth_pam.c* mod_auth_unix.c
to see if it works.
 
Old 11-24-2008, 06:32 PM   #3
salter
Member
 
Registered: Oct 2008
Posts: 100

Rep: Reputation: 15
I'm not sure, but shouldn't '#AuthPAMConfig proftpd' be uncommented?

Linux Archive

Last edited by salter; 12-20-2008 at 12:01 PM.
 
Old 11-25-2008, 02:15 PM   #4
delite
Member
 
Registered: Nov 2008
Posts: 44

Original Poster
Rep: Reputation: 15
Don't know how but i'd tried the following before and it didn't work?
Code:
AuthOrder	mod_sql.c
So I re-tried your line bathory, and it worked, then cut back to only checking the sql db and it still worked. I'm v glad it works, don't know why it didn't before, but who cares (me next time!), but many thanks...

CHEERS!
 
  


Reply

Tags
proftpd


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Proftpd and mysql authentication question Galam Linux - Networking 0 09-14-2005 10:31 AM
proftpd+mysql install problems nisse2004 Linux - Software 2 08-08-2005 10:09 PM
proftpd with mysql auth pumazi Linux - Software 0 07-03-2005 01:30 PM
ProFTPd & MySQL Authentication Help CyonyC Linux - Software 4 06-22-2004 03:37 PM
Proftpd and Mysql ???? dinhtuan Linux - Software 0 03-09-2004 02:30 PM


All times are GMT -5. The time now is 07:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration