Anzeige:
Ergebnis 1 bis 2 von 2

Thema: HowTo zum erstellen eines ProFTP SuSE 10.1 rpm's

  1. #1
    Registrierter Benutzer Avatar von Ulli Ivens
    Registriert seit
    Jan 2001
    Ort
    Heinsberg im Rheinland, Deutschland
    Beiträge
    1.844

    Lightbulb HowTo zum erstellen eines ProFTP SuSE 10.1 rpm's

    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.
    Gruß Ulli

    ---------
    Notebook: MacBookPro | Late 2012, 16 GB RAM | Software: Mac OS X 10.8.2 | Parallels mit Ubuntu 12.4 mit XFCE und Windows 8 | NetAachen DSL 6000, FritzBox Fon 7270 | mehrere DD-WRT AP's

  2. #2
    Rain_maker
    Gast

    Nachtrag zum rpmbuild

    Da das tar.bz2 ein geeignetes spec-File enthält, geht der BUILD auch einfacher, namentlich direkt aus dem Tarball.

    Code:
    rpmbuild -ta /Pfad_zum_tar.bz2/proftpd-1.3.0.tar.bz2
    
    Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.94222
    + umask 022
    
    -------snip ------- (*ratter ratter*)-----------------------
    
    Checking for unpackaged file(s): /usr/lib/rpm/check-files /usr/src/packages/BUILD/proftpd-1.3.0-root
    Wrote: /usr/src/packages/SRPMS/proftpd-1.3.0-1.src.rpm
    Wrote: /usr/src/packages/RPMS/i586/proftpd-1.3.0-1.i586.rpm
    Wrote: /usr/src/packages/RPMS/i586/proftpd-inetd-1.3.0-1.i586.rpm
    Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.7835
    + umask 022
    + cd /usr/src/packages/BUILD
    + cd proftpd-1.3.0
    + rm -rf /usr/src/packages/BUILD/proftpd-1.3.0-root
    + rm -rf /usr/src/packages/BUILD/proftpd-1.3.0
    + exit 0
    Voilà

    Greetz,

    RM
    Geändert von Rain_maker (23.10.06 um 11:05 Uhr)

Ähnliche Themen

  1. Patch DVD Suse 10.1 erstellen
    Von hn01 im Forum System installieren und konfigurieren
    Antworten: 2
    Letzter Beitrag: 01.08.06, 09:29
  2. Zen Double Trouble
    Von Gargi im Forum System installieren und konfigurieren
    Antworten: 9
    Letzter Beitrag: 14.06.06, 08:31
  3. Suse 10.1 Laggt nach neustart
    Von LemmyXP im Forum System installieren und konfigurieren
    Antworten: 10
    Letzter Beitrag: 23.05.06, 21:29
  4. Schwarzer Bildschirm nach Treiber installation
    Von Lordofthematrix im Forum X-Konfiguration
    Antworten: 12
    Letzter Beitrag: 01.11.04, 13:55
  5. Nvidia treiber suse8.2
    Von Venator im Forum System installieren und konfigurieren
    Antworten: 18
    Letzter Beitrag: 21.03.04, 21:31

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •