CONTENT
  • CHANGES
Szukaj
counter

#top Instalacja


Instalację serwera Pure-FTPd można wykonać na różne sposoby: od kompilacji ze źdródeł poprzez instalację pojedynczych paczek rpm za pomocą polecenia rpm skończywszy na instalacja z użyciem menedżera pakietów, który zainstaluje wszystkie niezbędne paczki wraz zależnościami.
Celem niniejszego dokumentu nie jest rozważanie różnych metod instalacji tylko nieco usprawnienie użyteczności konfiguracji serwera Pure-FTPd po zainstalowaniu.
Wszystko to zostało opisane poniżej.



#top Poinstalacyjna konfiguracja


#top Create log directory


mkdir /var/log/pureftpd



#top Create file /etc/ftpusers for pam.d rules file


touch /etc/ftpusers



#top Correct logrotate file


sed '1s,^,/var/log/pureftpd/pureftpd.log ,g' -i /etc/logrotate.d/pure-ftpd



#top Create ftp-home directory


mkdir /srv/ftpd
chown ftp:ftp /srv/ftpd
touch /srv/ftpd/ftpd-file



#top Update system account ftp


cat /etc/passwd | grep  ^ftp

ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin

Shell for user must be /sbin/nologin, home directory for user would be /srv/ftpd
ftp:x:14:50:FTP User:/srv/ftpd:/sbin/nologin

usermod -s /sbin/nologin ftp
usermod -d /srv/ftpd ftp





#top Update config


- max clients login from PerIP 2 shouldbe enough
sed 's,^\(MaxClientsPerIP.*\)$,#\1\nMaxClientsPerIP             2,g' -i /etc/pure-ftpd/pure-ftpd.conf

- disable logging to syslog
sed 's,^\(SyslogFacility.*\)$,#\1\nSyslogFacility              none,g' -i /etc/pure-ftpd/pure-ftpd.conf

- enable Authentication Unix (/etc/passwd)
sed 's,^\(# UnixAuthentication.*yes\)$,\1\nUnixAuthentication            yes,g' -i /etc/pure-ftpd/pure-ftpd.conf

- update path to log file
sed 's,^\(AltLog.*\)$,#\1\nAltLog                     clf:/var/log/pureftpd/pureftpd.log,g' -i /etc/pure-ftpd/pure-ftpd.conf



#top after above changes file should looks like


Interesting options config file /etc/pure-ftpd/pure-ftpd.conf:
# Cage in every user in his home directory

ChrootEveryone              yes
# Maximum number of sim clients with the same IP address

#MaxClientsPerIP             8
MaxClientsPerIP             2
# Don't allow authenticated users - have a public anonymous FTP only.

AnonymousOnly               no

# Disallow anonymous connections. Only allow authenticated users.

NoAnonymous                 no
# Syslog facility (auth, authpriv, daemon, ftp, security, user, local*)
# The default facility is "ftp". "none" disables logging.

#SyslogFacility              ftp
SyslogFacility              none
# Don't resolve host names in log files. Logs are less verbose, but
# it uses less bandwidth. Set this to "yes" on very busy servers or
# if you don't have a working DNS.

DontResolve                 yes
# If you want to enable PAM authentication, uncomment the following line

PAMAuthentication             yes

# If you want simple Unix (/etc/passwd) authentication, uncomment this

# UnixAuthentication            yes
UnixAuthentication            yes
# Are anonymous users allowed to create new directories ?

AnonymousCanCreateDirs      no
# Disallow anonymous users to upload new files (no = upload is allowed)

AnonymousCantUpload         yes
# Create an additional log file with transfers logged in a Apache-like format
# :
# fw.c9x.org - jedi [13/Dec/1975:19:36:39] "GET /ftp/linux.tar.bz2" 200
# 21809338
# This log file can then be processed by www traffic analyzers.

#AltLog                     clf:/var/log/pureftpd.log
AltLog                     clf:/var/log/pureftpd/pureftpd.log





#top start pureftpd server


/etc/init.d/pure-ftpd start

tail -f /var/log/pureftpd/pureftpd.log

















































Zmodyfikowany ostatnio: 2015/10/09 15:41:36 (8 lat temu), textsize: 4,01 kB, htmlsize: 10,0 kB

Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników