Opsætning af proftpd
Hej, Jeg er ved at opsætte en proftpd-server med mysql.Min opsætning er som følger:
#
# To have more informations about Proftpd configuration
# look at : http://www.proftpd.org/
#
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.
ServerName "Proftpd server"
ServerType standalone
DefaultServer on
# 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
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30
# Set the user and group under which the server will run.
User nobody
Group nogroup
# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~
#Used to log failuers fomr proftpd server
SystemLog /var/log/proftpd.log
#Manual added scoreboard
ScoreboardFile /var/run/proftpd.scoreboard
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>
# A basic anonymous configuration, no upload directories. If you do not
# want anonymous users, simply delete this entire <Anonymous> section.
#########################################################################
# #
# Uncomment lines with only one # to allow basic anonymous access #
# #
#########################################################################
#<Anonymous ~ftp>
# User ftp
# Group ftp
### We want clients to be able to login with "anonymous" as well as "ftp"
# UserAlias anonymous ftp
### Limit the maximum number of anonymous logins
# MaxClients 10
### We want 'welcome.msg' displayed at login, and '.message' displayed
### in each newly chdired directory.
# DisplayLogin welcome.msg
# DisplayFirstChdir .message
### Limit WRITE everywhere in the anonymous chroot
# <Limit WRITE>
# DenyAll
# </Limit>
#</Anonymous>
<Global>
#######################################
# The SQL part
# Connect to the database
SQLConnectInfo proftpd@localhost bs1006 proftpd
# How to autenthicate
SQLAuthTypes Plaintext
# The info for the login
SQLUserInfo users userid password uid gid homedir NULL
SQLAuthenticate users
#################
SQLNamedQuery getcount SELECT "count, userid from users where userid='%u'"
SQLNamedQuery updatecount UPDATE "count=count+1 WHERE userid='%u'" users
SQLShowInfo PASS "230" "You've logged on %{getcount} times, %u"
SQLLog PASS updatecount
#################
#
#######################################
# Since we don't require a valid shell.. :)
RequireValidShell off
Umask 022
AllowStoreRestart on
AllowRetrieveRestart on
<Directory /tmp>
AllowOverwrite off
HideNoAccess on
<Limit READ>
AllowAll
</Limit>
<Limit Write>
DenyAll
</Limit>
</Directory>
# For the local users that log in, so they get full permissions on their home director
<Directory ~>
AllowOverwrite on
<Limit STOR CMD MKD WRITEi RETR DELE RMD>
AllowALL
</Limit>
</Directory>
# The upload folder, so everybody can write and create folders in it
# Aswell the default user to chown stuff
<Directory /tmp>
UserOwner 1001
AllowOverwrite on
<Limit STOR CMD MKD WRITE>
AllowALL
</Limit>
<Limit RETR DELE RMD>
DenyALL
</Limit>
</Directory>
</Global>
MaxLoginAttempts 3 # Max 3 login attempts
MaxClientsPerHost 5 "Not more than %m simultanous connections!" # Max of 1 client from every host
MaxClients 10 "Not more than %m connection at once, sorry." # Max connecitions at once
/////////////////////////////////////////////
Jeg får følgende fejlmeddelse når jeg forsøger at logge ind:
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): performing ident lookup
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): ROOT PRIVS at inet.c:243
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): RELINQUISH PRIVS at inet.c:259
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): ident connection failed: Connection refused
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): ident lookup returned 'UNKNOWN'
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): ROOT PRIVS at main.c:1005
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): SETUP PRIVS at main.c:1010
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): FTP session requested from unknown class
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): performing module session initializations
Aug 28 14:23:23 mickey proftpd[1139] mickey (192.168.1.1[192.168.1.1]): FTP session closed.
Er der nogle som har en ide til hvor og hvordan jeg kan begynde at fejlfinde på server? Eller måske løsningen på problemet:-)
Når jeg forsøger at logge ind via localhost får jeg følgende fejl meddelse:
421 Service not available, remote server has closed connection.
Hvis jeg fjerne følgende kan jeg logge ind som de almindelig bruger på systemet:
<Global>
#######################################
# The SQL part
# Connect to the database
SQLConnectInfo proftpd@localhost bs1006 proftpd
# How to autenthicate
SQLAuthTypes Plaintext
# The info for the login
SQLUserInfo users userid password uid gid homedir NULL
SQLAuthenticate users
#################
SQLNamedQuery getcount SELECT "count, userid from users where userid='%u'"
SQLNamedQuery updatecount UPDATE "count=count+1 WHERE userid='%u'" users
SQLShowInfo PASS "230" "You've logged on %{getcount} times, %u"
SQLLog PASS updatecount
#################
#
#######################################
# Since we don't require a valid shell..
RequireValidShell off
Umask 022
AllowStoreRestart on
AllowRetrieveRestart on
<Directory /*>
AllowOverwrite off
HideNoAccess on
<Limit READ>
AllowAll
</Limit>
<Limit Write>
DenyAll
</Limit>
</Directory>
# For the local users that log in, so they get full permissions on their home director
<Directory ~>
AllowOverwrite on
<Limit STOR CMD MKD WRITEi RETR DELE RMD>
AllowALL
</Limit>
</Directory>
# The upload folder, so everybody can write and create folders in it
# Aswell the default user to chown stuff
<Directory /ftp/Upload/*>
UserOwner 1001
AllowOverwrite on
<Limit STOR CMD MKD WRITE>
AllowALL
</Limit>
<Limit RETR DELE RMD>
DenyALL
</Limit>
</Directory>
</Global>