Hallo zusammen,
bislang gab es kein rpm für proFTPD 1.3.0 und SuSE 10.1. Ich habe mal eines gebaut und ein Startscript dafür geschrieben/angepasst. Das Start-Script sieht so aus:
Code:
#! /bin/sh
### BEGIN INIT INFO
# Provides: proftpd
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: proftp
# Description: Start proftp Server
### END INIT INFO
# Check for missing binaries (stale symlinks should not happen)
PROFTPD_BIN=/usr/sbin/proftpd
test -x $PROFTPD_BIN || { echo "$PROFTPD_BIN not installed"; exit 5; }
# proftpd runs as this user
PROFTPDUSER=root
. /etc/rc.status
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting proftpd "
startproc -u $PROFTPDUSER $PROFTPD_BIN
rc_status -v
;;
stop)
echo -n "Shutting down proftpd "
killproc -TERM $PROFTPD_BIN
rc_status -v
;;
restart)
$0 stop
$0 start
rc_status -v
;;
status)
echo -n "Checking for service proftpd "
checkproc $PROFTPD_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
rc_exit
Das Startscript (bei mir heisst es proftpd) muss dann nach /etc/init.d/ gelegt werden.
Damit der Server dann nicht als root läuft muss man die proftpd.conf entsprechend bearbeiten (siehe rote Hervorhebung)
Hier meine Konfiguration die astrein läuft:
- Vorraussetzung:
1.) Die Firewall muss mitmachen
2.) Der User "foo" muss existieren, der Gruppe "users" angehören und ein Passwort haben. Damit dann nicht jeder per ssh (wenns dann läuft) connecten kann, solltet ihr als shell für den User "foo" /bin/false setzten (in der Datei /etc/passwd)
Code:
ServerName "blabla ProFTP Server 1.3.0"
ServerType standalone
DefaultServer on
# Allow FTP resuming.
# Remember to set to off if you have an incoming ftp for upload.
AllowStoreRestart on
# Port 21 is the standard FTP port.
Port 21
PassivePorts 5000 5010
# 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 5
# 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 ~
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
DenyAll
</Limit>
# Needed for NIS.
PersistentPasswd off
# Default root can be used to put users in a chroot environment.
# As an example if you have a user foo and you want to put foo in /home/foo
# chroot environment you would do this:
#
# DefaultRoot /home/foo foo
DefaultRoot /mnt/data/foo foo
<Anonymous /mnt/data/foo>
#grundsaetzliche einstellungen fuer foo account
User foo
Group users
Umask 011
RequireValidShell off
AnonRequirePassword on
AuthAliasOnly off
AuthUsingAlias off
AllowOverwrite on
AllowStoreRestart on
AllowRetrieveRestart on
#schreiben generell nicht erlauben
<Directory *>
<Limit WRITE MKD STOR>
DenyAll
</Limit>
</Directory>
#im verzeichnis upload freie hand lassen, ausser loeschen von verzeichnissen und dateien
<Directory upload>
<Limit WRITE STOR READ CWD MKD>
AllowAll
</Limit>
<Limit RMD DELE>
DenyAll
</Limit>
</Directory>
</Anonymous>
Das RPM kann ich hier leider nicht posten, wer's haben will kann mich anmailen oder folgendermaßen selber bauen:
1.) proftpd-1.3.0.tar.bz2 von www.proftpd.org runterladen
2.) Eine Kopie dieser Datei in /usr/src/packages/SOURCES legen (nicht entpacken)
3.) Das in dieser Datei enthaltene spec-file proftpd.spec nach /usr/src/packages/SPECS legen.
4.) rpmbuild -ba proftpd.spec im Verzeichnis /usr/src/packages/SPECS ausführen
5) Das fertige RPM aus /usr/src/packages/RPMS/[architektur] installieren.
Ist eigentlich gar nicht so schwer. Wenn das compilieren Abhängigkeiten benötigt, müssen diese mit YAST nachinstalliert werden.
Wenn dann alles wunderbar läuft kann man das startscript mittels
chkconfig proftpd on
dauerhaft beim Systemstart einbinden.
Lesezeichen