Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
Nächste ÜberarbeitungBeide Seiten der Revision
centos:rsynd_c8 [04.07.2020 20:34. ] – angelegt djangocentos:rsynd_c8 [05.07.2020 13:22. ] – [rsync-Daemon konfigurieren] django
Zeile 19: Zeile 19:
  
  
 +
 +
 +=== rsync-Daemon konfigurieren ===
 +Der rsync-Daemon wird über seine Konfigurationsdatei **''/etc/rsyncd.conf''** konfiguriert. Alle Konfigurationsparameter und einige Beispiele finden sich in der man-page zur Konfigurationsdatei.
 +Bei Bedarf lohnt sich ein Blick in diese Datei sicherlich!
 +   # man /etc/rsyncd.conf
 +
 +Wir legen uns also unsere individuelle Konfigurationsdatei an.
 +   # vim /etc/rsyncd.conf
 +<file bash /etc/rsyncd.conf>################################################################################
 +#                                                                              #
 +#    Django : 2020-07-04 - Musterkonfiguration rsync-Daemon unter CentOS 8     #
 +#                                                                              #
 +################################################################################
 +
 +# Eine Aufstellung aller möglichen Variablen findet man in der man-page zu
 +# rsyncd.conf : # man rsyncd.conf 
 +# Auf der Webseite https://dokuwiki.nausch.org/doku.php/centos:rsynd_c8
 +# findet man darüber hinaus noch viele Erklärungen zur Konfiguration des
 +# rsyn-Daemon.
 +
 +################################################################################
 +## GLOBAL PARAMETERS
 +#
 +
 +# This parameter allows you to specify a "message of the day" to display to  
 +# clients on each connect. This usually contains site information and any 
 +# legal notices. The default is no motd  file.
 +# motd file
 +
 +# This parameter tells the rsync daemon to write its process ID to that file.
 +# If  the file already exists, the rsync daemon will abort rather than overwrite 
 +# the file.
 +# pid file = /var/run/rsyncd.pid
 +
 +# Specifies the default port the daemon will listen (defaults to 873).
 +# port 873
 +
 +# Defines the default IP address where the daemon will listening. The default
 +# is listening on all IPv4 and IPv6-adresses.
 +# address
 +
 +# This  parameter specifies  the  user  name or user ID that file transfers 
 +# to and from that module should take place as when the daemon  was run as 
 +# root. In combination with the "gid" parameter this determines what file 
 +# permissions are available. The default when run by a super-user is to 
 +# switch to the system’s "nobody" user. The default for a non-super-user is 
 +# to not try to change the user. See also the "gid" parameter.
 +uid = nobody
 +
 +# This parameter specifies one or more group names/IDs that will be used when
 +# accessing the module. The first one will be the default group, and any extra 
 +# ones be set as supplemental groups.
 +# You may also specify a "*" as the first gid in the list, which will be 
 +# replaced by all the normal groups for the transfer’s user (see "uid"). The 
 +# default when run by a super-user is to switch to your OS’s "nobody" (or 
 +# perhaps "nogroup") group with no other supplementary groups. The default for
 +# a non-super-user is to not change any group attributes (and indeed, your OS
 +# may not allow a non-super-user to try to change their group settings).
 +gid = nobody
 +
 +# When the "log file" parameter is set to a non-empty string, the rsync daemon
 +# will log messages to the indicated file rather than using syslog. This is 
 +# particularly useful on systems (such as AIX) where syslog() doesn’t work for
 +# chrooted programs. The file is opened before chroot() is called, allowing it 
 +# to be placed outside the transfer. If this value is set on a per-module basis
 +# instead of globally, the global log will still contain any authorization 
 +# failures or config-file error messages.
 +# If the daemon fails to open the specified file, it will fall back to using
 +# syslog and output an error about the failure.
 +# log file = /var/log/rsyncd.log
 +
 +# This parameter allows you to specify the syslog tag to use when logging 
 +# messages from the rsync daemon. The default is "rsyncd".
 +# This setting has no effect if the "log file" setting is a non-empty string
 +# (either set in the per-modules settings, or inherited from the global 
 +# settings).
 +# syslog tag = rsyncd
 +
 +# This parameter allows you to specify the syslog facility name to use when 
 +# logging messages from the rsync daemon. You may use any standard syslog 
 +# facility name which is defined on your system.
 +# Common names are auth, authpriv, cron, daemon, ftp, kern, lpr, mail, news,
 +# security, syslog, user, uucp, local0, local1, local2, local3, local4, local5,
 +# local6 and local7. The default is daemon. This setting has no effect if the 
 +# "log file" setting is a non-empty string (either set in the per-modules 
 +# settings, or inherited from the global settings).
 +# syslog facility = daemon
 +
 +# This parameter enables per-file logging of downloads and uploads in a format 
 +# somewhat similar to that used by ftp daemons. The daemon always logs the 
 +# transfer at the end, so if a transfer is aborted, no mention will be made in 
 +# the log file.
 +# transfer logging = yes
 +
 +# This parameter allows you to specify the maximum number of simultaneous 
 +# connections you will allow. Any clients connecting when the maximum has been
 +# reached will receive a message telling them to try later. The default is 0, 
 +# which means no limit. A negative value disables the module. 
 +# max connections = 0
 +
 +# This parameter specifies the directory in the daemon’s filesystem to make 
 +# available in this module. You must specify this parameter for each module 
 +# in rsyncd.conf.
 +# path = /home/ftp
 +
 +# This parameter takes a space-separated list of daemon exclude patterns. As
 +# with the client --exclude option, patterns can be qualified with " " or
 +# "  " to explicitly indicate exclude/include. Only one "exclude" parameter
 +# can apply to a given module. 
 +# exclude = lost+found/
 +
 +# If "use chroot" is true, the rsync daemon will chroot to the "path" before 
 +# starting the file transfer with the client. This has the advantage of extra 
 +# protection against possible implementation security holes, but it has the 
 +# disadvantages of requiring super-user privileges, of not being able to 
 +# follow symbolic links that are either absolute or outside of the new root
 +# path and of complicating the preservation of users and groups by name
 +# See rsyncd.conf man page for more options.
 +# use chroot = yes
 +
 +# This parameter allows you to override the clients choice for I/O timeout for
 +# this module. Using this parameter you can ensure that rsync won’t wait on a 
 +# dead client forever. The timeout is pecified in seconds. A value of zero 
 +# means no timeout and is the  default. A good choice for anonymous rsync 
 +# daemons may be 600 (giving a 10 minute timeout).
 +timeout = 600
 +
 +# This tells the rsync daemon to completely ignore files that are not readable
 +# by the user. This is useful for public archives that may have some non-read-
 +# able files among the directories, and the sysadmin doesn’t want those files 
 +# to be seen at all.
 +# ignore nonreadable = yes
 +
 +# This parameter allows you to select filenames based on wildcard patterns that
 +# should not be compressed when pulling files from the daemon (no analogous 
 +# parameter exists to govern the pushing of files to a daemon). Compression is
 +# expensive in terms of CPU usage, so itis usually good to not try to compress 
 +# files that won’t compress well, such as already compressed files.
 +# The "dont compress" parameter takes a space-separated list of case-insensi-
 +# tive wildcard patterns. Any source filename matching one of the patterns will
 +# not be compressed during transfer.
 +# dont compress   = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
 +
 +################################################################################
 +## MODULES
 +#
 +# A module begins with the name of the module in square brackets and continues 
 +# until the next module begins. Modules contain parameters of the form 
 +# "name = value".
 +
 +# This parameter specifies the directory in the daemon’s filesystem to make 
 +# available in this module. You must specify this parameter for each module in
 +# rsyncd.conf.
 +# path = /srv/rsync-path
 +
 +# This parameter specifies a description string that is displayed next to the 
 +# module name when clients obtain a list of available modules. 
 +# The default is no comment.
 +# comment = 
 +
 +# This parameter determines whether this module is listed when the client asks
 +# for a listing of available modules. In addition, if this is false, the daemon
 +# will pretend the module does not exist when a client denied by "hosts allow"
 +# or "hosts deny" attempts to access it. Realize that if "reverse lookup" is 
 +# disabled globally but enabled for the module, the resulting reverse lookup
 +# to a potentially client-controlled DNS server may still reveal to the client
 +# that it hit an existing module. The default is for modules to be listable.
 +# list = yes
 +
 +# This parameter allows you to specify a list of comma- and/or whitespace-
 +# separated patterns that are matched against a connecting  clients hostname
 +# and IP address. If the pattern matches then the connection is rejected.
 +# hosts deny = 192.168.1.0/24
 +
 +# This parameter allows you to specify a list of comma- and/or whitespace-
 +# separated patterns that are matched against a connecting  client’s  
 +# hostname and IP address. If none of the patterns match, then the connec-
 +# tion is rejected.
 +# hosts allow = *.mailserver.guru
 +
 +# Module examples:
 +# [ftp]
 +# path            = /var/ftp/./pub
 +# comment         = whole ftp area (approx 6.1 GB)
 +#
 +# [object]
 +# max connections = 2
 +# path            = /srv/node/
 +# read only       = false
 +# write only      = no
 +# list            = yes
 +# incoming chmod  = 0644
 +# outgoing chmod  = 0644
 +# lock file       = /var/lock/object.lock
 +# hosts allow     = *.mailserver.guru
 +
 +#[REPO]
 +#path       = /srv/public/mailserver.guru/
 +#comment    = repo.mailserver.guru
 +#allow = 88.217.171.167
 +
 +[demo]
 +max connections = 2
 +path            = /var/lib/tftpboot/
 +comment         = Demo für rsync Daemon Artikel in Djangos WIKI
 +list            = yes
 +hosts allow     = 10.0.0.0/24</file>
 +
 +=== rsynd.service starten =====
 +Nun ist es an der Zeit unseren rsync-Daemon Server das erste mal mit Hilfe von **systemd** zu starten.
 +   # systemctl start rsyncd.service
 +
 +Im Syslog wird uns der Start des Daemon entsprechend protokolliert.
 +<code>Jul  5 00:03:30 vml000190 rsyncd[5920]: rsyncd version 3.1.3 starting, listening on port 873
 +</code>
 +
 +Ob auf unserem Server nun der TFTP Server läuft und auf Port **69** horcht können wir bei Bedarf auch noch überprüfen.
 +   # netstat -tulpen | grep 873
 +
 +<html><pre class="code">
 +<font style="color: rgb(0, 0, 0)">tcp        0      0 0.0.0.0:</font><font style="color: rgb(255, 0, 0)"<b>873</b></font><font style="color: rgb(0, 0, 0)">             0.0.0.0:              LISTEN      0          428589     5920/rsync<font>
 +<font style="color: rgb(0, 0, 0)">tcp6            0 :::</font><font style="color: rgb(255, 0, 0)"<b>873</b></font><font style="color: rgb(0, 0, 0)">                  :::*                    LISTEN      0          428590     5920/rsync</font></pre>
 +</html>
 +
 +
 +Ebenso kann man den Status des Daemons mit Hilfe des Befehls **systemctl** abfragen.
 +   # systemctl status rsyncd.service
 +
 +<html><pre class="code">
 +<font style="color: rgb(29, 180, 29)"><b>●</b></font> rsyncd.service - fast remote file copy program daemon
 +   Loaded: loaded (/usr/lib/systemd/system/rsyncd.service; disabled; vendor preset: disabled)
 +   Active:<font style="color: rgb(29, 180, 29)"><b>active (running)</b></font> since Sun 2020-07-05 00:03:30 CEST; 3min 48s ago
 + Main PID: 5920 (rsync)
 +    Tasks: 1 (limit: 12494)
 +   Memory: 264.0K
 +   CGroup: /system.slice/rsyncd.service
 +           └─5920 /usr/bin/rsync --daemon --no-detach
 +
 +Jul 05 00:03:30 vml000190.dmz.nausch.org systemd[1]: Started fast remote file copy program daemon.
 +Jul 05 00:03:30 vml000190.dmz.nausch.org rsyncd[5920]: rsyncd version 3.1.3 starting, listening on port 873</font></pre>
 +</html>
 +
 +Den automatischen Start unseres TFTP-Serverdienstes aktivieren wir für den Systemstart nun noch mit:
 +   # systemctl enable rsyncd.service
 +
 +  Created symlink /etc/systemd/system/multi-user.target.wants/rsyncd.service → /usr/lib/systemd/system/rsyncd.service.
 +
 +Ob der rsyncd-Service gestartet wird können wir bei Bedarf wie folgt abfragen:
 +   # systemctl is-enabled rsyncd.service
 +
 +  enabled
  
  
  • centos/rsynd_c8.txt
  • Zuletzt geändert: 11.04.2021 13:48.
  • von django