proFTP Installation mit APT-Get

bwar

Registered User
Hallo!

Ich habe Confixx über Bord geworfen und will jetzt einen FTP-Server isntallieren. Leider geht das mehr schlecht als recht.

Mein Root hat Debian 3.1

Ich habe es mit apt-get versucht und konnte proFTP installieren. Aber wenn ich den Server starten will, kommt nur die fehlermeldung:

server:~# /etc/init.d/proftpd start
ProFTPd warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration.



Was mache ich falsch? Gibt es auch andere FTP-Server?

Die Config:
Code:
#
# /etc/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
# 

ServerName			"Debian"
ServerType			inetd
DeferWelcome			off

MultilineRFC2228		on
DefaultServer			on
ShowSymlinks			on

TimeoutNoTransfer		600
TimeoutStalled			600
TimeoutIdle			1200

DisplayLogin                    welcome.msg
DisplayFirstChdir               .message
ListOptions                	"-l"

DenyFilter			\*.*/

# Uncomment this if you are using NIS or LDAP to retrieve passwords:
PersistentPasswd		off

# Uncomment this if you would use TLS module:
TLSEngine 			on

# Uncomment this if you would use quota module:
Quotas				on

# Uncomment this if you would use ratio module:
Ratios				on

# Port 21 is the standard FTP port.
Port				21

# 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 that the server normally runs at.
User				nobody
Group				nogroup

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask				022  022
# Normally, we want files to be overwriteable.
AllowOverwrite			on

# Delay engine reduces impact of the so-called Timing Attack described in
# [url]http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02[/url]
# It is on by default. 
#DelayEngine 			off

# A basic anonymous configuration, no upload directories.

<Anonymous ~ftp>
   User				ftp
  Group				nogroup
   # We want clients to be able to login with "anonymous" as well as "ftp"
   UserAlias			anonymous ftp
   # Cosmetic changes, all files belongs to ftp user
   DirFakeUser	on ftp
   DirFakeGroup on ftp
 
   RequireValidShell		off
 
   # 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
   <Directory *>
     <Limit WRITE>
       DenyAll
     </Limit>
   </Directory>
 
   # Uncomment this if you're brave.
    <Directory incoming>
      # Umask 022 is a good standard umask to prevent new files and dirs
      # (second parm) from being group and world writable.
      Umask				022  022
               <Limit READ WRITE>
               DenyAll
               </Limit>
               <Limit STOR>
               AllowAll
               </Limit>
    </Directory>
 
 </Anonymous>
 
Last edited by a moderator:
bwar said:
ServerType inetd
Fällt Dir was auf?
Nein? Dann liß nochmal die Fehlermeldung und dann das Zitat.

Lösung:
Die Config steht auf den Aufruf aus der inetd.
Normalerweise sollte beim installieren auch ein entsprechender inetd Eintrag gesetz worden sein. Also brauchst Du lediglich inetd neustarten und mit 'ftp localhost' testen.

huschi.
 
sorry aber jetzt habe ich auch das Problem.

initd neugestartet aber trotzdem geht der Proftpd nicht.
Die Configuration ist die selbe wie oben.

local funktioniert er ebenfals nicht.
 
na gerne doch.

Code:
#!/bin/sh 

# Start the proftpd FTP daemon.

PATH=/bin:/usr/bin:/sbin:/usr/sbin

# Defaults
RUN="no"
OPTIONS=""
CONF=/etc/proftpd.conf

test -f $DAEMON || exit 0

# Read config (will override defaults)
[ -r /etc/default/proftpd ] && . /etc/default/proftpd

if [ ! -r $CONF ]; then
	echo "Missing configuration file $CONF"
	exit 0
fi

NAME=proftpd
DAEMON=/usr/sbin/$NAME

PIDFILE=$(grep -i 'pidfile' $CONF | sed -e 's/pidfile[\t ]\+//i')
if [ "x$PIDFILE" = "x" ];
then
	PIDFILE=/var/run/$NAME.pid
fi

trap "" 1
trap "" 15


#
# Test if configuration file provided is ok
#
$DAEMON -t -c $CONF >/dev/null 2>&1
if [ $? -ne 0 ]; then
	ISOK="$NAME"$($DAEMON -t 2>&1|grep ' - ')
else
	ISOK="yes"
fi

#
# Servertype could be inetd|standalone|none.
# In all cases check against inetd and xinetd support.
#
ENABLED=$RUN
if ! egrep -qi "^[[:space:]]*ServerType.*standalone" $CONF
then
    if [ $(dpkg-divert --list xinetd|wc -l) -eq 1 ] 
    then
	if egrep -qi "server[[:space:]]*=[[:space:]]*$DAEMON" /etc/xinetd.conf 2>/dev/null || \
	   egrep -qi "server[[:space:]]*=[[:space:]]*$DAEMON" /etc/xinetd.d/* 2>/dev/null
	then
    		RUN="no"
    		INETD="yes"
	else
		if ! egrep -qi "^[[:space:]]*ServerType.*inetd" $CONF
		then
    			RUN="yes"
			INETD="no"
		else
			RUN="no"
			INETD="no"
		fi
	fi
    else
    	if egrep -qi "^ftp.*$NAME" /etc/inetd.conf 2>/dev/null
    	then
    		RUN="no"
    		INETD="yes"
    	else
		if ! egrep -qi "^[[:space:]]*ServerType.*inetd" $CONF
		then
    			RUN="yes"
			INETD="no"
		else
			RUN="no"
			INETD="no"
		fi
    	fi
    fi
fi

start()
{
    if [ "$ISOK" != "yes" ]; then
	echo "$ISOK"
    else
        if start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec $DAEMON -- $OPTIONS -c $CONF; then
           echo "$NAME"
        else
           echo "failed"
        fi
    fi
}

signal()
{
    if [ "$1" = "stop" ]; then
	SIGNAL="TERM"
    else
	if [ "$1" = "reload" ]; then
	    SIGNAL="HUP"
	else
	    echo "ERR: wrong parameter given to signal()"
	fi
    fi
    if start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"; then
        echo "$NAME"
    else
	SIGNAL="KILL"
	if start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"; then
		echo "$NAME"
	else
        	echo "failed"
	fi
    fi
    if [ "$SIGNAL" = "KILL" ]; then
	    rm -f "$PIDFILE"
    fi
}

case "$1" in
    start)
	if [ "x$RUN" = "xyes" ] ; then
	    echo -n "Starting ProFTPD ftp daemon: "
	    start
	else
	    if [ "x$INETD" = "xyes" ] ; then
		echo "ProFTPd is started from inetd/xinetd."
	    else 
	        if [ "x$ENABLED" = "xyes" ]; then
	    	  echo "ProFTPd warning: not start neither in standalone nor in inetd/xinetd mode, apparently. Check your configuration."
		else
	    	  echo "ProFTPd disabled by admin. See /etc/default/proftpd."
		fi
	    fi
	fi
	;;

    force-start)
	if [ "x$INETD" = "xyes" ] ; then
	    echo "Warning: ProFTPd is started from inetd/xinetd (trying to start anyway)."
	fi
	echo -n "Starting ProFTPD ftp daemon: "
	start
	;;	
    
    stop)
	if [ "x$RUN" = "xyes" ] ; then
	    echo -n "Stopping ProFTPD ftp daemon: "
	    signal stop
	else
	    if [ "x$INETD" = "xyes" ] ; then
		echo "ProFTPd is started from inetd/xinetd."
	    else 
	        if [ "x$ENABLED" = "xyes" ]; then
	    	  echo "ProFTPd warning: not started neither in standalone nor in inetd/xinetd mode, apparently. Check your configuration."
		else
	    	  echo "ProFTPd disabled by admin. See /etc/default/proftpd."
		fi
	    fi
	fi
	;;

    force-stop)
	if [ "x$INETD" = "xyes" ] ; then
	    echo "Warning: ProFTPd is started from inetd/xinetd (trying to kill anyway)."
	fi
	echo -n "Stopping ProFTPD ftp daemon: "
	signal stop
	;;

    reload)
	if [ "$ISOK" != "yes" ]; then
		echo "$ISOK"
	else
		echo -n "Reloading $NAME configuration..."
		signal reload
		echo " done."
    	fi
	;;

    force-reload|restart)
	if [ "x$RUN" = "xyes" ] ; then
	    if [ "$ISOK" != "yes" ]; then
	        echo "$ISOK"
	    else
	   	echo -n "Restarting ProFTPD ftp daemon."
	   	signal stop
	   	echo -n "."
	    	sleep 2
	    	echo -n "."
	    	start
	    	echo " done"
	    fi
	else
	    if [ "x$INETD" = "xyes" ] ; then
		echo "ProFTPd is started from inetd."
	    else 
	        if [ "x$ENABLED" = "xyes" ]; then
	    	  echo "ProFTPd warning: not started neithr in standalone nor in inetd/xinetd mode, apparently. Check your configuration."
		else
	    	  echo "ProFTPd disabled by admin. See /etc/default/proftpd."
		fi
	    fi
	fi
	;;

    *)
	echo "Usage: /etc/init.d/$NAME {start|force-start|stop|force-stop|reload|restart|force-reload}"
	exit 1
	;;
esac

exit 0
 
Last edited by a moderator:
Sorry, bin auf der Arbeit und zwischen dürch am Basteln.

Code:
#!/bin/sh
#
# start/stop inetd super server.

if ! [ -x /usr/sbin/inetd ]; then
	exit 0
fi

checkportmap () {
    if grep -v "^ *#" /etc/inetd.conf | grep 'rpc/' >/dev/null; then
        if ! [ -x /usr/bin/rpcinfo ]
        then
            echo
            echo "WARNING: rpcinfo not available - RPC services may be unavailable!"
            echo "         (Commenting out the rpc services in inetd.conf will"
	    echo "         disable this message)"
            echo
        elif ! /usr/bin/rpcinfo -u localhost portmapper >/dev/null 2>/dev/null
        then
            echo
            echo "WARNING: portmapper inactive - RPC services unavailable!"
            echo "         (Commenting out the rpc services in inetd.conf will"
	    echo "         disable this message)"
            echo
        fi
    fi
} 

case "$1" in
    start)
        checkportmap
	echo -n "Starting internet superserver:"
	echo -n " inetd" ; start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
	echo "."
	;;
    stop)
	echo -n "Stopping internet superserver:"
	echo -n " inetd" ; start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
	echo "."
	;;
    reload)
	echo -n "Reloading internet superserver:"
	echo -n " inetd"
	start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid --signal 1
	echo "."
	;;
    force-reload)
	$0 reload
	;;
    restart)
	echo -n "Restarting internet superserver:"
	echo -n " inetd"
	start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/inetd.pid
	checkportmap
	start-stop-daemon --start --quiet --pidfile /var/run/inetd.pid --exec /usr/sbin/inetd
	echo "."
	;;
    *)
	echo "Usage: /etc/init.d/inetd {start|stop|reload|restart}"
	exit 1
	;;
esac

exit 0
MOD: Bitte Code auch in CODE-Tag setzen!
 
Last edited by a moderator:
Da will mich jemand partou nicht verstehen.
Ich will keine Start-Skripte sehen, sondern die Config.
Nochmal langsam: den FTP-Konfigurations-Eintrag in der inetd.conf.

huschi
 
Code:
# /etc/inetd.conf:  see inetd(8) for further informations.
#
# Internet server configuration database
#
#
# Lines starting with "#:LABEL:" or "#<off>#" should not
# be changed unless you know what you are doing!
#
# If you want to disable an entry so it isn't touched during
# package updates just comment it out with a single '#' character.
#
# Packages should modify this file by using update-inetd(8)
#
# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
#
#:INTERNAL: Internal services
#echo		stream	tcp	nowait	root	internal
#echo		dgram	udp	wait	root	internal
#chargen	stream	tcp	nowait	root	internal
#chargen	dgram	udp	wait	root	internal
#discard	stream	tcp	nowait	root	internal
#discard	dgram	udp	wait	root	internal
#daytime	stream	tcp	nowait	root	internal
#daytime	dgram	udp	wait	root	internal
#time		stream	tcp	nowait	root	internal
#time		dgram	udp	wait	root	internal

#:STANDARD: These are standard services.
ftp	stream	tcp	nowait	root	/usr/sbin/tcpd /usr/sbin/proftpd

#:BSD: Shell, login, exec and talk are BSD protocols.

#:MAIL: Mail, news and uucp services.

#:INFO: Info services

#:BOOT: Tftp service is provided primarily for booting.  Most sites
# run this only on machines acting as "boot servers."

#:RPC: RPC based services

#:HAM-RADIO: amateur-radio services

#:OTHER: Other services

Sorry bin etwas daneben
 
Langer Thread kurzer Sinn. (bisher)
Also, in der inetd.conf steht er ja korrekt drin. (Pfadangaben geprüft?)

Nächster Schritt:
inetd neu starten und in der messages/syslog nachsehen, ob er einen Fehler bringt.

Wenn Nein:
telnet localhost 21

huschi.
 
Danke, auch wenn ich es nicht verstehe. Ich habe den Server neugestartet und danach ging es wieder.

:confused: :confused: :confused: :confused:
 
eben das ging ja nicht. Inetd neugestartet der ftp war aber immer noch nicht erreichbar.

Weis nicht warum jedenfals jetzt gehts.
 
Warum muss es denn unbedingt über den inetd sein?

Schreib doch als Type: standalone und fertig. :rolleyes:

Gruß
Thunda
 
Code:
ServerName	SERVERNAME
ServerIdent	on "FTP Server"
ServerAdmin	SERVERADMIN
ServerType	standalone
Port	21
DefaultServer	on
IdentLookups	off
UseReverseDNS off
User	nobody
Group	nogroup
Umask	022
DefaultRoot	~
ListOptions	""
AllowOverwrite	on
MaxClientsPerHost	5 "Mehr als %m gleichzeitige Logins sind nicht erlaubt"
MaxInstances	30
MaxLoginAttempts	8
TimeoutIdle	320
TimeoutNoTransfer	320
TimeoutStalled	320
TimesGMT	off
TransferLog	/var/log/xferlog

<Global>
	AllowForeignAddress	on
	AllowOverwrite	on
	AllowRetrieveRestart	on
	AllowStoreRestart	on
	RequireValidShell	off
	RootLogin	off
	ShowSymlinks	off
</Global>
Das ist mal meine Konfig. Ersetze das GROSSGESCHRIEBENE und Du hast einen wunderbar funktionierenden Server. Und inetd läuft bei mir nicht mal...

Dazu noch User, die KEINEN SHELLZUGRIFF haben und deren Homeverzeichnis das FTP rootverzeichnis ist. Wenn die FTP Accounts für Webseiten genutzt werden, sollte der FTP User in der gleichen Gruppe wie der Apache sein (www-data). Dann klappts auch mit der Websitedarstellung.

Gruß
Thunda
 
Last edited by a moderator:
Back
Top