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`