From 52858bf02c605fb2eec96aa3a70c43d4356bf043 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sat, 26 Sep 2020 13:47:54 +0200 Subject: [PATCH] Update.. --- group_vars/all/main.yml | 113 ++ host_vars/192.168.82.20.yml | 67 + host_vars/file-akb.akb.netz.yml | 21 + host_vars/pcbuero1.flr.netz.yml | 37 - roles/common/files/etc/samba/users.map | 18 + .../system/rpcbind.socket.d/override.conf | 7 + .../nis_allow_network.conf | 7 + roles/common/handlers/main.yml | 5 + roles/common/tasks/basic.yml | 27 + roles/common/tasks/main.yml | 7 + roles/common/tasks/nis-install-server.yml | 4 +- roles/common/tasks/samba-install.yml | 16 + roles/common/tasks/sshd.yml | 28 + roles/common/templates/etc/samba/smb.conf.j2 | 1305 ++++------------- .../templates/etc/samba/smb.conf.j2.BAK | 1048 +++++++++++++ .../templates/etc/security/limits.conf.j2 | 62 + roles/common/templates/etc/ssh/sshd_config.j2 | 349 +++++ 17 files changed, 2100 insertions(+), 1021 deletions(-) create mode 100644 host_vars/192.168.82.20.yml delete mode 100644 host_vars/pcbuero1.flr.netz.yml create mode 100644 roles/common/files/etc/samba/users.map create mode 100644 roles/common/tasks/sshd.yml create mode 100644 roles/common/templates/etc/samba/smb.conf.j2.BAK create mode 100644 roles/common/templates/etc/security/limits.conf.j2 create mode 100644 roles/common/templates/etc/ssh/sshd_config.j2 diff --git a/group_vars/all/main.yml b/group_vars/all/main.yml index 39d2837..abb3489 100644 --- a/group_vars/all/main.yml +++ b/group_vars/all/main.yml @@ -15,6 +15,65 @@ locales: set_default_limit_nofile: false +# --- +# vars used by roles/common/tasks/sshd.yml +# --- + +sshd_ports: + - 22 + +sshd_listen_address: + - '::' + - '0.0.0.0' + +sshd_host_keys: + - /etc/ssh/ssh_host_rsa_key + - /etc/ssh/ssh_host_ecdsa_key + - /etc/ssh/ssh_host_ed25519_key + +sshd_max_startups: !!str "10:30:100" + +sshd_max_auth_tries: 3 + +sshd_max_sessions: 10 + +sshd_permit_root_login: !!str "yes" + +sshd_authorized_keys_file: ".ssh/authorized_keys .ssh/authorized_keys2" + +sshd_pubkey_authentication: !!str "yes" + +sshd_password_authentication: !!str "no" + +sshd_use_pam: !!str "yes" + +sshd_print_motd: !!str "no" + +# sshd_kexalgorithms +# +# Example: +# sshd_kexalgorithms: +# - curve25519-sha256@libssh.org +# - diffie-hellman-group-exchange-sha256 +# - diffie-hellman-group14-sha1 +# +sshd_kexalgorithms: {} + +# sshd_kexalgorithms +# +# Example: +# sshd_ciphers: +# - chacha20-poly1305@openssh.com +# - aes256-gcm@openssh.com +# - aes256-ctr +sshd_ciphers: {} + +sshd_use_dns: !!str "no" + +sshd_allowed_users: {} + + + # ========== # vars used by roles/common/tasks/apt.yml # ========== @@ -156,6 +215,7 @@ apt_initial_install_stretch: - quotatool - needrestart - socat + - wakeonlan apt_initial_install_buster: - apt-transport-https @@ -268,6 +328,7 @@ apt_initial_install_buster: - quotatool - needrestart - socat + - wakeonlan apt_initial_install_xenial: - apt-transport-https @@ -625,6 +686,17 @@ nfs_exports: - 192.168.63.0/24 fs_encrypted: false + - src: 192.168.82.10:/data/samba + path: /data/samba + mount_opts: user,exec,rsize=8192,wsize=8192,hard,intr + export_opt: rw,fsid=0,root_squash,sync,subtree_check + export_networks: + - 192.168.82.0/24 + - 10.0.82.0/24 + - 10.1.82.0/24 + - 192.168.63.0/24 + fs_encrypted: false + # ========== # vars used by roles/common/tasks/samba-install.yml @@ -634,6 +706,8 @@ apt_install_server_samba: - samba - nscd +# - winbind + apt_install_client_samba: - samba-client - samba-common @@ -860,6 +934,9 @@ nis_user: samba_shares: - name: Transfer + path: /data/samba/Transfer + group_valid_users: transfer + group_write_list: transfer user: - anna - buero @@ -872,6 +949,9 @@ samba_shares: - thomas - frauke - name: Verwaltung + path: /data/samba/Verwaltung + group_valid_users: verwaltung + group_write_list: verwaltung user: - anna - jonas @@ -886,6 +966,9 @@ samba_shares: - thomas - frauke - name: Scans + path: /data/samba/Scans + group_valid_users: scans + group_write_list: scans user: - anna - buero @@ -899,30 +982,57 @@ samba_shares: - thomas - frauke - name: Buero_Scans + path: /data/samba/Scans/Buero_Scans + group_valid_users: scans + group_write_list: scans user: - buero - name: Frauke_Scans + path: /data/samba/Scans/Frauke_Scans + group_valid_users: scans + group_write_list: scans user: - frauke - name: FSJ_Scans + path: /data/samba/Scans/FSJ_Scans + group_valid_users: scans + group_write_list: scans user: - fsj - name: Jibran_Scans + path: /data/samba/Scans/Jibran_Scans + group_valid_users: scans + group_write_list: scans user: - jibran - name: Julia_Scans + path: /data/samba/Scans/Julia_Scans + group_valid_users: scans + group_write_list: scans user: - julia - name: Maica_scans + path: /data/samba/Scans/Maica_scans + group_valid_users: scans + group_write_list: scans user: - maica - name: Thomas_Scans + path: /data/samba/Scans/Thomas_Scans + group_valid_users: scans + group_write_list: scans user: - thomas - name: Birgit_Scans + path: /data/samba/Scans/Birgit_Scans + group_valid_users: scans + group_write_list: scans user: - birgit - name: Kamera + path: /data/samba/Kamera + group_valid_users: intern + group_write_list: intern user: - anna - buero @@ -933,6 +1043,9 @@ samba_shares: - thomas - frauke - name: Install + path: /data/samba/Install + group_valid_users: intern + group_write_list: intern user: - anna - buero diff --git a/host_vars/192.168.82.20.yml b/host_vars/192.168.82.20.yml new file mode 100644 index 0000000..900ffd6 --- /dev/null +++ b/host_vars/192.168.82.20.yml @@ -0,0 +1,67 @@ +--- + +ansible_python_interpreter: /usr/bin/python3 + + +# --- +# vars used by roles/common/tasks/basic.yml +# --- + +set_default_limit_nofile: true + +# --- +# vars used by roles/common/tasks/sshd.yml +# --- + +sshd_max_auth_tries: 6 + +sshd_permit_root_login: !!str "yes" + +sshd_password_authentication: !!str "yes" + +sshd_use_pam: !!str "no" + +sshd_print_motd: !!str "yes" + +# ========== +# vars used by roles/common/tasks/nfs.yml +# ========== + +nfs_server: 192.168.82.20 + +# Set 'fs_encrypted' to true if filesystem lives on an encrypted +# partition. +# +nfs_exports: + - src: 192.168.82.20:/data/home + path: /data/home + mount_opts: user,exec,rsize=8192,wsize=8192,hard,intr + export_opt: rw,fsid=0,root_squash,sync,subtree_check + export_networks: + - 192.168.82.0/24 + - 10.0.82.0/24 + - 10.1.82.0/24 + - 192.168.63.0/24 + fs_encrypted: false + + - src: 192.168.82.20:/data/samba + path: /data/samba + mount_opts: user,exec,rsize=8192,wsize=8192,hard,intr + export_opt: rw,fsid=0,root_squash,sync,subtree_check + export_networks: + - 192.168.82.0/24 + - 10.0.82.0/24 + - 10.1.82.0/24 + - 192.168.63.0/24 + fs_encrypted: false + +# ========== +# vars used by roles/common/tasks/nis-install-server.yml +# vars used by roles/common/tasks/nis-user.yml +# vars used by roles/common/tasks/nis-install-client.yml +# ========== + +# also used by template +# - yp.conf.j2 +nis_server_address: 192.168.82.10 + diff --git a/host_vars/file-akb.akb.netz.yml b/host_vars/file-akb.akb.netz.yml index 165337e..6e0b0f3 100644 --- a/host_vars/file-akb.akb.netz.yml +++ b/host_vars/file-akb.akb.netz.yml @@ -1,3 +1,24 @@ --- ansible_python_interpreter: /usr/bin/python3 + + +# --- +# vars used by roles/common/tasks/basic.yml +# --- + +set_default_limit_nofile: true + +# --- +# vars used by roles/common/tasks/sshd.yml +# --- + +sshd_max_auth_tries: 6 + +sshd_permit_root_login: !!str "yes" + +sshd_password_authentication: !!str "yes" + +sshd_use_pam: !!str "no" + +sshd_print_motd: !!str "yes" diff --git a/host_vars/pcbuero1.flr.netz.yml b/host_vars/pcbuero1.flr.netz.yml deleted file mode 100644 index 9eda88a..0000000 --- a/host_vars/pcbuero1.flr.netz.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- - -# --- -# NFS -# --- - - -# --- -# Samba / NIS -# --- - - -# --- -# vars used by roles/ansible_dependencies -# --- - - - -# --- -# vars used by roles/ansible_user -# --- - - -# --- -# vars used by roles/common/tasks/basic.yml -# --- - - -# --- -# vars used by roles/common/tasks/sudoers.yml -# --- - -sudoers_file_cmnd_aliases: - - name: MOUNT - entry: '/bin/mount,/bin/umount,/usr/bin/smb4k_mount' - - diff --git a/roles/common/files/etc/samba/users.map b/roles/common/files/etc/samba/users.map new file mode 100644 index 0000000..60ce62e --- /dev/null +++ b/roles/common/files/etc/samba/users.map @@ -0,0 +1,18 @@ +# ############################################ # +# -------------------------- # +# ** DO NOT EDIT DIRECTLY ** # +# -------------------------- # +# Ansible managed file # +# ############################################ # + +# This file allows you to map usernames from the clients to the server. +# Unix_name = SMB_name1 SMB_name2 ... +# +# See section 'username map' in the manual page of smb.conf for more +# information. +# +# This file is _not_ included in the default configuration as it makes the +# usage of an user named administrator impossible. + +root = admin administrator + diff --git a/roles/common/files/etc/systemd/system/rpcbind.socket.d/override.conf b/roles/common/files/etc/systemd/system/rpcbind.socket.d/override.conf index 480847b..e5dd16e 100644 --- a/roles/common/files/etc/systemd/system/rpcbind.socket.d/override.conf +++ b/roles/common/files/etc/systemd/system/rpcbind.socket.d/override.conf @@ -1,3 +1,10 @@ +# ############################################ # +# -------------------------- # +# ** DO NOT EDIT DIRECTLY ** # +# -------------------------- # +# Ansible managed file # +# ############################################ # + [Unit] DefaultDependencies=no Wants=rpcbind.target diff --git a/roles/common/files/etc/systemd/system/systemd-logind.service.d/nis_allow_network.conf b/roles/common/files/etc/systemd/system/systemd-logind.service.d/nis_allow_network.conf index 20d1465..9b89e4a 100644 --- a/roles/common/files/etc/systemd/system/systemd-logind.service.d/nis_allow_network.conf +++ b/roles/common/files/etc/systemd/system/systemd-logind.service.d/nis_allow_network.conf @@ -1,3 +1,10 @@ +# ############################################ # +# -------------------------- # +# ** DO NOT EDIT DIRECTLY ** # +# -------------------------- # +# Ansible managed file # +# ############################################ # + [Service] IPAddressAllow=192.168.0.0/16 diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 0d53f07..e33dc86 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -1,5 +1,10 @@ --- +- name: Restart ssh + service: + name: ssh + state: restarted + - name: Renew nis databases shell: make -C /var/yp when: diff --git a/roles/common/tasks/basic.yml b/roles/common/tasks/basic.yml index 8e0b3be..3ece4ba 100644 --- a/roles/common/tasks/basic.yml +++ b/roles/common/tasks/basic.yml @@ -21,6 +21,8 @@ owner: root group: root state: link + when: + - "groups['file_server']|string is search(inventory_hostname)" tags: - symlink-sh @@ -43,3 +45,28 @@ - etc_systemd_system_conf.stat.exists == true tags: - systemd-nofiles + + +- name: (basic.yml) Check file '/etc/security/limits.conf.ORIG' exists + stat: + path: /etc/security/limits.conf.ORIG + register: etc_security_limits_conf_ORIG + tags: + - limits-conf + +- name: (basic.yml) Backup installation version of file '/etc/security/limits.conf' + command: cp -a /etc/security/limits.conf /etc/security/limits.conf.ORIG + when: etc_security_limits_conf_ORIG.stat.exists == False + tags: + - limits-conf + +- name: (basic.yml) Create new sshd_config from template limits.conf.j2 + template: + src: etc/security/limits.conf.j2 + dest: /etc/security/limits.conf + owner: root + group: root + mode: 0644 + tags: + - limits-conf + diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index c20b030..c801259 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -10,6 +10,13 @@ - basic +# tags supported inside sshd.yml +# +# sshd-config +- import_tasks: sshd.yml + tags: sshd + + # tags supported inside apt.yml # # apt-update diff --git a/roles/common/tasks/nis-install-server.yml b/roles/common/tasks/nis-install-server.yml index 34c67c3..46c1f42 100644 --- a/roles/common/tasks/nis-install-server.yml +++ b/roles/common/tasks/nis-install-server.yml @@ -134,13 +134,13 @@ - name: (nis-install-server.yml) Ensure directoriy 'nis_base_home' (usually /data/home) exists file: - path: '{{ nis_base_home}}' + path: '{{ nis_base_home }}' owner: root group: root mode: '0755' state: directory when: - - "groups['nfs_server']|string is search(inventory_hostname)" + - "groups['nis_server']|string is search(inventory_hostname)" tags: - nis-install - nis-install-server diff --git a/roles/common/tasks/samba-install.yml b/roles/common/tasks/samba-install.yml index ffbb9f4..30659b4 100644 --- a/roles/common/tasks/samba-install.yml +++ b/roles/common/tasks/samba-install.yml @@ -35,6 +35,22 @@ - samba-server +- name: (samba-install.yml) Ensure file /etc/samba/users.map exists + copy: + src: "{{ role_path + '/files//etc/samba/users.map' }}" + dest: /etc/samba/users.map + owner: root + group: root + mode: 0644 + when: + - "groups['samba_server']|string is search(inventory_hostname)" + notify: + - Restart smbd + - Restart nmbd + tags: + - samba-server + + - name: (samba-install.yml) /etc/samba/smb.conf template: dest: /etc/samba/smb.conf diff --git a/roles/common/tasks/sshd.yml b/roles/common/tasks/sshd.yml new file mode 100644 index 0000000..3ab1b69 --- /dev/null +++ b/roles/common/tasks/sshd.yml @@ -0,0 +1,28 @@ +--- + +- name: (sshd.yml) Check file '/etc/ssh/sshd_config.ORIG' exists + stat: + path: /etc/ssh/sshd_config.ORIG + register: etc_sshd_sshd_config_ORIG + tags: + - sshd-config + +- name: (sshd.yml) Backup installation version of file '/etc/ssh/sshd_config' + command: cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.ORIG + when: etc_sshd_sshd_config_ORIG.stat.exists == False + tags: + - sshd-config + +- name: (sshd.yml) Create new sshd_config from template sshd_config.j2 + template: + src: etc/ssh/sshd_config.j2 + dest: /etc/ssh/sshd_config + owner: root + group: root + mode: 0644 + validate: 'sshd -f %s -T' + #backup: yes + notify: "Restart ssh" + tags: + - sshd-config + diff --git a/roles/common/templates/etc/samba/smb.conf.j2 b/roles/common/templates/etc/samba/smb.conf.j2 index 19374cc..dd63048 100644 --- a/roles/common/templates/etc/samba/smb.conf.j2 +++ b/roles/common/templates/etc/samba/smb.conf.j2 @@ -1,649 +1,348 @@ +# {{ ansible_managed }} + +# +# Sample configuration file for the Samba suite for Debian GNU/Linux. +# +# # This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the options listed -# here. Samba has a huge number of configurable options (perhaps too -# many!) most of which are not shown in this example +# here. Samba has a huge number of configurable options most of which +# are not shown in this example # -# For a step to step guide on installing, configuring and using samba, -# read the Samba HOWTO Collection. -# -# Any line which starts with a ; (semi-colon) or a # (hash) -# is a comment and is ignored. In this example we will use a # -# for commentry and a ; for parts of the config file that you -# may wish to enable -# -# NOTE: Whenever you modify this file you should run the command "testparm" -# to check that you have not made any basic syntactic errors. +# Some options that are often worth tuning have been included as +# commented-out examples in this file. +# - When such options are commented with ";", the proposed setting +# differs from the default Samba behaviour +# - When commented with "#", the proposed setting is the default +# behaviour of Samba but the option is considered important +# enough to be mentioned here # +# NOTE: Whenever you modify this file you should run the command +# "testparm" to check that you have not made any basic syntactic +# errors. -#======================= Globale Einstellungen ===================================== +#======================= Global Settings ======================= [global] - # workgroup = name - # - # Der Sambaserver wird Mitglied der Arbeitsgruppe "name". - # Diese Gruppenzuordnung ist sehr lose. jedeR kann in die - # Gruppe ein- oder austreten ohne irgendwelche - # Sicherheitskriterien zu erfüllen. Anders als bei den - # Domänen. - # !! Bei aktivierter Domänenfunktion wird dieser Parameter - # Domänname verwendetals !! - # - ## aktuell: workgroup = workgroup - ;workgroup = Aktionsbuendnis - workgroup = WORKGROUP +## Browsing/Identification ### - # netbios=name - # - # NetBIOS ist im Gegensatz zu DNS ein flacher Namensraum - # ohne Hirarchie. - # Diese Namen werden vollkommen dynamisch vergeben. Bootet - # ein (Windows)-Rechner, so versucht er seinen eigen - # NetBIOS-Namen zu reservieren. existiert dieser schon, so - # hat der neue Rechnwer Pech gehabt und kann nicht am Netzwerk - # teilnehmen. - # Damit wird für den Server "name" registriert. Unter diesem - # ist er für die Sambaclients ansprechbar. - # NetBIOS-Namen sind nicht unbedingt nur auf Computer anwendbar. - # Auch angemeldete Benutzer und Computergruppen können mit - # NetBIOS-Namen angesprochen werden. - # - ## aktuell: netbios name = anita - netbios name = FILE +# Change this to the workgroup/NT-domain name your Samba server will part of +; workgroup = WORKGROUP + workgroup = AKB - name resolve order = lmhosts wins bcast host +# Option 'netbios name' added to debian's default smb.conf +# +# This sets the NetBIOS name by which a Samba server is known. By default it +# is the same as the first component of the host's DNS name. If a machine is +# a browse server or logon server this name (or the first component of the +# hosts DNS name) will be the name that these services are advertised under. +# +# Note that the maximum length for a NetBIOS name is 15 characters. +# +# Default: netbios name = # machine DNS name + netbios name = FILE-AKB - # server string = name - # - # Die Kommentarzeile des Servers. - # - ## aktuell: server string = anita +# server string (G) +# +# This controls what string will show up in the printer comment box in print manager and next to the IPC +# connection in net view. It can be any string that you wish to show to your users. +# +# It also sets what will appear in browse lists next to the machine name. +# +# A %v will be replaced with the Samba version number. +# +# A %h will be replaced with the hostname. +# +# Default: server string = Samba %v +# server string = File Server ( Samba %v ) - # kernel oplocks = yes | no - # oplock ( opportunistischer Lock) auf betriebssystemebene. - # In der Regel werden Daten ( Dateien ) zwischengespeichert - # und nicht jede Änderung gleich geschrieben. Samba kann intern - # (Parameter oplock einer Freigabe s.u.) davon gebrauch machen. - # Mit "kernel oplocks" kann dies auch auf Betriebssystemebene - # eingestellt werden. Es kann also sowohl per Samba als auch etwa - # direkt unter Unix/Linux oder NFS zugegriffen werden ohne auf - # die Geschwindigkeitsvorteile des Oplocks zu verzichten. - # Standardmäßig ist dieser Parameter aktiviert, sofern das - # Betriebssystem dies unterstützt (derzeit IRIX und Linux - # Kernel 2.4) - # - # !!! soll "level2 oplocks" aktiviert werden, so darf muß - # "kernel oplocks" deaktiviert werden. (s.u.) - # - ## aktuell: kernel oplocks = yes - kernel oplocks = no - # oplock break wait time = - # Dies ist (eigentlich) ein Tuning-Parameter, der aufgrund - # von fehlerhaften Windowsbetriebssystemen aufgenommen wurde: - # Antwortet Samba zu schnell auf Anfragen, die einen "oplock break - # request" zur Folge haben können, so kann die Verbindung fehlschlagen - # und der client antwortet nicht auf den break request. Mit diesem - # Parameter wird Samba angewiesen die angegebene Zeit (in Millisekunden) - # zu warten, bevor ein oplock break request gesendet wird. - # Standardeinstellung: oplock break wait time = 0 - # - # by the way: - # SMB, steht für Server Message Block, und ist ein Protokoll - # welches die gemeinsame Benutzung von Dateien, Druckern, - # seriellen Ports, auch "named pipes" und "mail slots" zwischen - # Computern erlaubt. - # 2002-09-24 ch: fix oplock break prob? - oplock break wait time = 10 +#### Networking #### - # deadtime = n - # nach n Minuten Inakrivität wird die Verbindung - # unterbrochen. - # - deadtime = 0 - - # keepalive = n - # überprüft alle n Sekunden, ob ein client noch erreichbar - # ist (ob er überhaupt noch lebt ). Wenn nicht, geht der - # Server davon aus, daß der client abgeschaltet oder abgestürzt - # ist und beendet die Verbindung. - # !! Besser ist es, dies nicht auf Samba-Ebene sondern auf - # Verbindungsebene zu regeln ( mit "socket options") - # - ## aktuell: keepalive = 30 - keepalive = 0; - - # socket options = OPTIONS - # - # TCP_NODELAY - # ist standardmäßig aktiviert. Pakete werden - # sofort abgeschickt. Normalerweise wird bei - # kleinen Datenmengen gewartet bis "genügend" - # Daten zusammen sind damit es sich lohnt diese - # übers Netz zu schicken. - # - # SO_KEEPALIVE - # Bei TCP-Verbindungen wird mit dieser Option - # erreicht, daß die Gegenstelle der Verbindung - # auf Erreichbarkeit und Funktionsbereitschaft - # überprüft wird. Ist dies nicht der Fall, so - # wird die Verbindung beendet - # - # SO_BROADCAST - # Erlaubt das Versenden von Broadcast-Meldungen an - # das gesamte Netzwerk. - # - # SO_REUSEADDR - # Erlaubt die Weiterverwendung von Socketadressen - # - # IPTOS_LOWDELAY - # IPTOS_THROUGHPUT - # Diese beiden Optionen sind fuer das routing. Soll die - # direkte (IPTOS_LOWDELAY) oder die mit mehr Bandbreite - # (IPTOS_THROUGHPUT) benutz werden ? Die meisten Router - # reagieren auf die entsprechenden Einträge in den - # Paketheadern nicht, so sind diese Socketoptionen meistens - # sinnlos - # - # SO_SNDBUF = - # der Sendepuffer kann mit dieser Option gesetzt werden - # Bemerkung: siehe SO_RCVBUF - # - # SO_RCVBUF = - # Der Empfangspuffer kann mit dieser Option gesetzt werden - # Bemerkung: - # Mit den beiden Optionen SO_SNDBUF und SO_RCVBUF kann der - # letzte Schliff in die Konfiguration gebracht werden. Wer - # aber nicht wirklich ein Geschwindigkeitsfanatiker ist, - # sollte die Finger davon lassen - # - # SO_SNDLOWAT = - # SO_RCVLOWAT = - # Diese beiden Parameter definieren, wievile Daten vorhanden sein - # müssen, damit sie vom socket weitergeleitet werden. Auch dies - # sollte gelassen werdewn wie es ist. Unter Linux kann das - # Verhalten gar nicht verändert werdeb - # - ## aktuell: socket options = SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY - socket options = TCP_NODELAY - - # security = share | user | server | domain - # - # Mit diesem Parameter wird der Sicherheitsmodus eingestellt. Es - # wird das "security mode bit" gesetzt. Es werden zur Zeit die vier - # unten aufgelisteten Modi unterstütz. - # - # share die Authentifizierung erfolgt auf Freigabeebene. Beim Einloggen - # Server wird noch keine Überprüfungen vorgenommen. Erst zum - # das Verbinden mit einer Freigabe ist ein Passwort (kein - # Benutzername) erforderlich. Windows sendet trotzdem ein - # Benutzername mit. Für Authentifizierung werden foldende - # Benutzer verwendet - # - wird ein benutzername mitgesendet wird zunächst dieser - # zur Anmeldung benutzt. - # - ist der rechner bereits beim Sambaserver angemeldet wird - # der hierbei verwendete Name benutzt - # - danach wird der Name der Freigabe benutzt - # - als nächstes wird der NetBIOS_Name des Clients versucht - # - schließlich werden die in der "username"_liste der Freigabe - # aufgeführten Namen versucht - # - falls der "guest ok" Parameter gesetzt, alle anderen - # Anmeldungen fehlschlugen, wird der "guest account" Name - # verwendet. - # - # user Bevor sich ein Client mit dem Server verbinden kann, muß er - # sich mit Benutzernamen und Passwort authentifizieren. Erst - # wenn dies erfolgreich war, wird die Liste der verfügbaren - # Freigaben gesendet - # - # server Dieser Modus funktioniert im Prinzip we der user-Modus. - # Allerdings wird zunächst ein anderer SMB-Server nach - # Benutzernamen und Passwort befragt (password server = Computername). - # Erst wenn dies fehlschlägt, wird in der eigenen Datenbank - # nachgeschaut. Dieser Modus ist durch den domain-Modus überholt. - # - # domain Ähnlich wie beim server-Modus wird auf die Benutzerauthentufizierung - # eines anderen Servers vertraut. Anders als beim server-Modus - # wird das NT-Domain-Sicherheitsprotokoll unterstützt. Das - # bedeute, daß auch Benutzer aus vertrauten Domänen der Zugang - # gestattet werden kann. - # - security = user - - - # encrypt passwords = yes | no - # aktiviert die Passwortverschlüsselung (= yes). Damit ist zwar - # die Verschlüsselung aktiviert, aber weil Microsoft eine andere - # Verschlüssellungsroutine benutzt als Linux, können die - # Linux-Paßwortdateien ("passwd","shadow" oder die NIS-Datenbank - # nicht benutzt werden. Samba benötigt eine eigene Paßwortdatei, - # üblicherweise heißt sie "smbpasswd" und liegt im private-Verzeichnis - # der Sambainstallation (s.u. parameter "smb passwd file") - # - encrypt passwords = true - - passdb backend = smbpasswd - - - # smb passwd file = Dateiname - # Gibt den Ort und Namen der Samba-Paßwortdatei an. Diese wird benötigt - # wenn Paßwortverschlüsselung benutzt wird. - # - # !!! Die Paßwotdatei und die darin befindlichen Hashwerte sind angreifbar. - # Sie sollte dem user "root" gehören und nur von ihm lesbar, beschreibbar - # und ausführbar sein. (chmod 700) - # - # benötigt: encrypt passwords = yes - # - ## aktuell: /etc/samba/smbpasswd - #smb passwd file = /usr/local/samba/private/smbpasswd - smb passwd file = /etc/samba/smbpasswd - - - # unix password sync = yes | no - # Wenn Kennwörter durch den Client oder durch das Passwortprogramm - # smbpasswd geändert werden, so müßte anschließend auch das "normale" - # unix-Passwort geändert werden, wenn nicht mit zwei verschiedenen - # Kennwörtenr gearbeitet werden soll. Das läßt sich durch diesen - # Parameter (yes) ändern. Falls dieser Parameter aus Yes eingestellt - # ist, wird das in dem Parameter "passwd program" angegebene Programm - # als ROOT aufgerufen, um zu erlauben, das neue Passwort zu setzen ohne - # das alte angeben zu müssen. - # - ## aktuell: unix password sync = no - unix password sync = yes - - - # passwd program = Dateinme - # Dieser Parameter gibt den Ort und Namen des Programms an, mit dem - # das UNIX-Passwort geändert werden kann (i.allg. /bin/passwd oder - # /usr/bin/passwd). Diese Programm wird als root ausgeführt und weiß - # nicht, für welchen Namen das Passwort geändert werden soll. Daher - # sollte diesem mit dem Makro %u der Benutzername übergeben werden. - # - # Beachte: Passwortprogramme sind i.d.R. interaktive Programme. Die - # Unterhaltung (Chat) muß mit Hilfe des Parameters "passwd chat" - # konfiguriert werden (s.u.). - # - # benötigt: unix password sync = yes - # - ## aktuell: passwd program = /bin/passwd - passwd program = /usr/bin/passwd %u - - - # passwd chat = "Ausgabestring" "Eingabestring" - # [ "Ausgabestring" "Eingabestring" ] [...] - # - # Mit den anzugebenden Zeichenketten wird die Unterhaltung zwischen - # dem passwd-Programm und dem smbd beim Ändern des Passwortes - # konfiguriert (eine oder mehrere aufeinanderfolgende Aus- und - # Eingabepaare). Die Ein- und Ausgabestrings sind durch ein Leerzeichen - # voneinader getrennt. Der Ausgabeteil besteht aus dem Text, welches das - # passwd-Programm ausgibt. Dabei ist es möglich, das Jokerzeichen "*", - # welches für eine beliebige auch 0-Zeichen lange Zeichenkette steht. - # Der Eingabeteil sind die Eingaben, die das passwd-Programm benötigt. - # Hierbei wird "%o" für das alte (wir in der Regel nicht gebraucht, da - # das passwd-Programm als user "root" aufgerufen wird und somit das alte - # Passwort nicht benötigt wird) und "%n" für das neue Passwort verwendet. - # Ferner können folgende Escapesequenzen benutzt werden: - # /n Zeilenvorschub - # /r Wagenrücklauf - # /t Tabulator - # /s Leerzeichen - # - # beachte:Ein String kann durch doppelte Anführungszeichen - # "zusammengehalten" werden. Um Leerzeichen in Passwörten - # zu ermöglichen sollten in der Chat-Zeile "%n" und "%o" durch - # doppelte Anführungszeichen geschützt werden. - # - # Das Chat-script ist case-sensitiv - # - # benötigt: unix password sync = yes - # - # Für Red Hat 7.2: - # passwd chat = *asswor*\n* "%n"\n *asswor* "%n"\n *success* - # - #passwd chat = *new*password* "%n"\n **new*password* "%n"\n *success* - passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . - - # guest account = - # Mit diesem Parameter werden Gastzugriffe einem echten - # Unix-Benutzer zugeordnet. ( Freigabe Parameter guset = ok - # oder guest only = yes) - # Standardeinstellung: guest account = nobody - # - ## aktuell: guest account = nobody - ; guest account = nobody - - # guest ok = yes |no - # Soll eine Freigabe auch für Gäste zugänglich sein, so ist dieser - # Parameter auf "yes" zu setzen - # - guest ok = no - - # map to guest = Never | Bad User | Bad Passwort - # Mit diesem Parameter wird eingestellt, was mit Anfrgaen - # passeirt, die keinen Benutzern und kein gültiges - # Passwort besitzen - # - # Never - # Requests mit ungültigem Passwort werden zurückgewiesen. Es - # werden noch nichteinmal die Freigaben gezeigt. - # (Standardeinstellung) - # - # Bad User - # Benutzer mit faslchem Passwort werden zurückgewiesen. Bei - # unbekanntem Benutzer wird auf den "guest account" gemappt - # - # Bad Password - # Benutzer mit falschem Passwort werden auf den "guest account" - # gemappt. - # VORSICHT: - # der Benutzer erkennt dies nicht und weiß somit - # nicht mit welchen Rechten er auf den Server zufreift. - # Das kann zu Verwirrungen führen. - # - ## aktuell: map to guest = Bad User - map to guest = Never - - # username map = - # Wenn auf den Windows-Clients ein Usere unter anderem Namen - # Auftritt als auf dem Samba-Server, so bietet sich eine Datei - # für die Zuordnung an - # Bsp.: - # root = admin administrator - # weist den usernamen admin oder administraor den unixnamen - # root zu - ; username map = /usr/local/samba/lib/users.map - - # hide files = [DateiOderVerzeichnis[/andereDateiOderVerzeichnis[/... - # Mir diesem Parameter kann eine Liste von Dateien und/oder - # Verzeichnissen angegeben werden, die nicht angezeigt werden - # sollen (hidden Attribut wird gesetzt). Die einzelnen - # Dateien/Verzeichnisse werden durch ein Slash "/" getrennt und - # können Wildcards "*" und "?" enthalten, nicht aber den Slash - # selbst. Die Eintraege mussen den UNIX Dateinamenkonventionen - # gehorchen. - # - ## aktuell: hide files = /DesktopFolderDB/TrashFor%m/resource.frk/Icon%0D/ - hide files = /.*/DesktopFolderDB/TrashFor%m/resource.frk/ - - # default case = upper | lower - # Standardschreibweise für neu angelegte Dateien - # Standardeinstellung: default case = lower - # - defaultcase = lower - - # preserve case = yes | no - # Mit diesem Parameter kann festgelegt werden, ob bei neu angelegte - # Dateien die Klein/Großschreibung des Clienten beibehalten - # wird (yes) oder die Standardeinstellung (Parameter "default case") - # benutzt wird (no). - # - preserve case = yes - - # short preserve case = yes | no - # Wie Parameter "preserve case" jedoch nur gültig für kurze - # im DOS-Format 8.3 gehaltene Dateien - # - short preserve case = yes - - # dos charset = - # Mit dieser Option wird der Zeichensatz eingestellt, mit dem Samba zu - # den DOS-Clienten sprechen soll - # Standardeinstellung: hängt von den installierten Zeichensätzen ab. Samba - # versucht den Zeichensatz 850 zu benutzen. Ist dieser nicht vorhanden, wird - # der ASCII Zeichensatz genommen. - # - dos charset = CP850 - - # unix charset = - # Gibt an, welchen Zeichensatz Samba (auf der Unix Maschine) benutzen soll. - # Diese Angabe wird benötigt, damit Samba weiß, wie es text für die clients konvertieren muß - # Standardeinstellung: unix charset = UTF8 - # - ##unix charset = ISO-8859-1 - unix charset = UTF8 - - # display charset = - # Zeichensatz den Sammba für Ausgaben auf stdout, stderr und für SWAT - # benutzt. Sollte der gleiche wie für den Parameter "unix charset" - # sein. - # Standardeinstellung: display charset = ASCII - # - ##display charset = ISO-8859-1 - #display charset = UTF8 - - - # valid chars - # In Samba 3.x nicht mehr verfügbar - ## aktuell valid chars = 0224:0231 0204:0216 0201:0232 - - # character set = - # In Samba 3.x nicht mehr verfügbar - ## aktuell: character set = ISO8859-15 - - # client code page = - # In Samba 3.x nicht mehr verfügbar - ## aktuell: client code page = 850 - - - os level = 50 - local master = yes - preferred master = yes - domain master = yes - - # wins support = yes | no - # Ist dieser Parameter auf yes, so übernimmt der nmbd die - # Funktion eines WINS-Servers. Die Datenbankdatei mit dem - # namen wins.dat (ascii-format) wird im lock-Verzeichnis - # gespeichert - # Standardeinstellung: wins support = no - # - # !! VORSICHT !! - # Es kann immer nur ein Samba-Server wins support aktiviert - # haben. Andernfalls kan es zu großen Problemen kommen. - #wins support = Yes - - # If you want Samba to use an existing wins server, please uncomment the - # following line and replace the dummy with the wins server's ip number. - ;wins server = 192.168.52.1 - - - - - # log file = - # Dieser Parameter erlaibt es, eine alternative Log-Datei - # anzulegen. (Die einkompilierten Angaben werden dabei - # Überschrieben). Durch Makros wird es möglich, für jeden - # Nutzer oder jede Maschine seperate Log_dateien zu schreiben: - # log file = /log.%u legt für jeden - # User eine eigene Protokolldatei an. - # - ## aktuel: deaktiviert - # - # für jede Maschine ein eigenes log-file - log file = /var/log/samba/%m.log - - # log level = 0-10 | 100 - # Dieser Parameter spezifiziert, wie ausführlich die Meldungen - # von Samba sein sollen. (0 nur kritische Fehlermeldungen) - # Der Wert 100 spielt eine besondere Rolle. err speichert die - # während der Authetifizierung verwendeten Passworte - # - ## aktuell: log level = 2 - log level = 2 - - # max log size (G) - # - # Gibt die Größe (in Kilobyte) an, bis zu der die Logfiles - # wachsen dürfen. - # Samba überprüft regelmäßig die Größe. Falls das angegebene - # Maximum überschritten ist, wird der Logdatei die Endung .old - # angehangen und eine neue angelegt. - # - # A size of 0 means no limit. - # - # Default: max log size = 5000 - # - # Example: max log size = 1000 - # - max log size = 5000 - - ## - To use the CUPS printing interface set - ## - printcap name = cups - ## - - ## - This should be supplemented by an addtional setting - ## - printing = cups - ## - - #printcap name = /etc/printcap - printcap name = cups - printing = cups - - ## - A boolean variable that controls whether all printers in the - ## - printcap will be loaded for browsing by default. - ## - - ## - Default: load printers = yes - ## - - load printers = Yes - - # interfaces = IP-Adress/Subnetzmaske[ IP-Adress/Subnetzmaske... - # Dieser Parameter gibt das bzw. die Netzwerk(e) an, die Samba - # verwendet. - # Standard: erstes gefundenes Netzwerk und 127.0.0.1 - # - # !! VORSICHT !! - # eben die Standardeinstellung kann zum Problem werden, da - # Samba häufig das Dummy-Device als solches erkennt. Auch wenn - # nur ein Netzwerk installiert ist, ist es also sinnvoll, diesen - # Parameter zu verwendn - # - ;interfaces = eth0 192.168.82.10/24 lo 127.0.0.1/8 - interfaces = {{ ansible_default_ipv4.address }}/24 127.0.0.1/8 +# The specific set of interfaces / networks to bind to +# This can be either the interface name or an IP address/netmask; +# interface names are normally preferred +; interfaces = 127.0.0.0/8 eth0 + interfaces = {{ ansible_default_ipv4.address }}/24 127.0.0.1/8 +# Option 'hosts deny' and 'hosts allow' added to debian's default smb.conf hosts deny = 0.0.0.0/0 hosts allow = 192.168.0.0/16 10.0.0.0/8 127.0.0.0/8 - # bindet nur an die im Parameter "interfaces" angegebenen Adressesn - # - # !! VORSICHT !! - # Wenn "bind interfaces only" gesetzt ist und die Netzwerkadresse - # 127.0.0.1 nicht im Parameter "interfaces" mit angegeben ist, dann - # arbeiten "smppasswd" und "swat" nicht wie erwartet. - # (siehe auch manpage smb.conf) - # - bind interfaces only = Yes - - local master = yes - prefered master = yes - domain master = yes - time server = yes +# Only bind to the named interfaces and/or networks; you must use the +# 'interfaces' option above to use this. +# It is recommended that you enable this feature if your Samba machine is +# not protected by a firewall or is a firewall itself. However, this +# option cannot handle dynamic or non-broadcast interfaces correctly. +# +# Notice: +# If bind interfaces only is set and the network address 127.0.0.1 is not added to the +# interfaces parameter list smbpasswd(8) may not work as expected due to the reasons +# covered below. +# +# Default: bind interfaces only = no + bind interfaces only = yes +#### Debugging/Accounting #### -# Do you wan't samba to act as a logon-server for your windows 95/98 -# clients, so uncomment the following: - domain logons = NO -# For a specific logon script per user -; logon script = %U.bat -# For a specific logon script per machine -; logon script = %m.bat +# This tells Samba to use a separate log file for each machine +# that connects +; log file = /var/log/samba/log.%m + log file = /var/log/samba/%I.log -# Where to store the logon scripts. -;[netlogon] -; comment = Network Logon Service -; path = /var/lib/samba/netlogon +# Cap the size of the individual log files (in KiB). +; max log size = 1000 + max log size = 10000 -# Where profiles of Windows 9x systems are stored. -# First example for a centralized place. -; logon home = \\%L\profiles\%U -# Second example for a subdirectory of the users home. -; logon home = \\%L\%U\profile -# Where profiles of Windows NT systems are stored. -; logon path = \\%L\profiles\%U +# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}. +# Append syslog@1 if you want important messages to be sent to syslog too. + logging = file + +# Option 'log level' added to debian's default smb.conf +# +# The value of the parameter (a astring) allows the debug level (logging level) to be +# specified in the smb.conf file. +# +# This parameter has been extended since the 2.2.x series, now it allows one to specify +# the debug level for multiple debug classes. This is to give greater flexibility in +# the configuration of the system. +# +# See manpage for implemented debug classes +# +# Default: log level = 0 +# +# Example: log level = 3 passdb:5 auth:10 winbind:2 +; log level = 0 + log level = 2 + +# Do something sensible when Samba crashes: mail the admin a backtrace + panic action = /usr/share/samba/panic-action %d +####### Authentication ####### -#============================ Freigaben ============================== +# Option 'ntlm auth' added to debian's default smb.conf +# +# This parameter determines whether or not smbd(8) will attempt to authenticate +# users using the NTLM encrypted password response for this local passdb (SAM +# or account database). +# +# If disabled, both NTLM and LanMan authencication against the local passdb is +# disabled. +# +# Note that these settings apply only to local users, authentication will still +# be forwarded to and NTLM authentication accepted against any domain we are +# joined to, and any trusted domain, even if disabled or if NTLMv2-only is +# enforced here. To control NTLM authentiation for domain users, this must option +# must be configured on each DC. +# +# By default with lanman auth set to no and ntlm auth set to ntlmv2-only only +# NTLMv2 logins will be permited. Most clients support NTLMv2 by default, but some +# older clients will require special configuration to use it. +# +# The primary user of NTLMv1 is MSCHAPv2 for VPNs and 802.1x. +# +# The available settings are: +# +# ntlmv1-permitted (alias yes) - Allow NTLMv1 and above for all clients. +# +# ntlmv2-only (alias no) - Do not allow NTLMv1 to be used, but permit NTLMv2. +# +# mschapv2-and-ntlmv2-only - Only allow NTLMv1 when the client promises that +# it is providing MSCHAPv2 authentication (such as the ntlm_auth tool). +# +# disabled - Do not accept NTLM (or LanMan) authentication of any level, nor +# permit NTLM password changes. +# +# The default changed from yes to no with Samba 4.5. The default chagned again to +# ntlmv2-only with Samba 4.7, however the behaviour is unchanged. +# +# Default: ntlm auth = ntlmv2-only + ntlm auth = ntlmv1-permitted -# Extra share for profiles. Default is the home of the user. -#[profiles] -# comment = Network Profiles Service -# path = /var/lib/samba/profiles -# browseable = No +# Server role. Defines in which mode Samba will operate. Possible +# values are "standalone server", "member server", "classic primary +# domain controller", "classic backup domain controller", "active +# directory domain controller". +# +# Most people will want "standalone server" or "member server". +# Running as "active directory domain controller" will require first +# running "samba-tool domain provision" to wipe databases and create a +# new domain. + server role = standalone server + + obey pam restrictions = yes + +# This boolean parameter controls whether Samba attempts to sync the Unix +# password with the SMB password when the encrypted SMB password in the +# passdb is changed. + unix password sync = yes + +# For Unix password sync to work on a Debian GNU/Linux system, the following +# parameters must be set (thanks to Ian Kahan < for +# sending the correct chat script for the passwd program in Debian Sarge). + passwd program = /usr/bin/passwd %u + passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . + +# This boolean controls whether PAM will be used for password changes +# when requested by an SMB client instead of the program listed in +# 'passwd program'. The default is 'no'. + pam password change = yes + +# This option controls how unsuccessful authentication attempts are mapped +# to anonymous connections + map to guest = bad user + +# Option 'username map' added to debian's default smb.conf +# + username map = /etc/samba/users.map + +########## Domains ########### + +# +# The following settings only takes effect if 'server role = primary +# classic domain controller', 'server role = backup domain controller' +# or 'domain logons' is set +# + +# It specifies the location of the user's +# profile directory from the client point of view) The following +# required a [profiles] share to be setup on the samba server (see +# below) +; logon path = \\%N\profiles\%U +# Another common choice is storing the profile in the user's home directory +# (this is Samba's default) +# logon path = \\%N\%U\profile + +# The following setting only takes effect if 'domain logons' is set +# It specifies the location of a user's home directory (from the client +# point of view) +; logon drive = H: +# logon home = \\%N\%U + +# The following setting only takes effect if 'domain logons' is set +# It specifies the script to run during logon. The script must be stored +# in the [netlogon] share +# NOTE: Must be store in 'DOS' file format convention +; logon script = logon.cmd + +# This allows Unix users to be created on the domain controller via the SAMR +# RPC pipe. The example command creates a user account with a disabled Unix +# password; please adapt to your needs +; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u + +# This allows machine accounts to be created on the domain controller via the +# SAMR RPC pipe. +# The following assumes a "machines" group exists on the system +; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u + +# This allows Unix groups to be created on the domain controller via the SAMR +# RPC pipe. +; add group script = /usr/sbin/addgroup --force-badname %g + +############ Misc ############ + +# Using the following line enables you to customise your configuration +# on a per machine basis. The %m gets replaced with the netbios name +# of the machine that is connecting +; include = /home/samba/etc/smb.conf.%m + +# Some defaults for winbind (make sure you're not using the ranges +# for something else.) +; idmap config * : backend = tdb +; idmap config * : range = 3000-7999 +; idmap config YOURDOMAINHERE : backend = tdb +; idmap config YOURDOMAINHERE : range = 100000-999999 +; template shell = /bin/bash + +# Setup usershare options to enable non-root users to share folders +# with the net usershare command. + +# Maximum number of usershare. 0 means that usershare is disabled. +# usershare max shares = 100 + +# Allow users who've been granted usershare privileges to create +# public shares, not just authenticated ones + usershare allow guests = yes + +#======================= Share Definitions ======================= + +# {{ ansible_managed }} [homes] - comment = Home Directories - read only = No - create mask = 0640 - directory mask = 0750 - browseable = No + comment = Home Directories + browseable = no - # By default, \\server\username shares can be connected to by anyone - # with access to the samba server. - # The following parameter makes sure that only "username" can connect - # to \\server\username - # This might need tweaking when using external authentication schemes +# By default, the home directories are exported read-only. Change the +# next parameter to 'no' if you want to be able to write to them. + read only = no + +# File creation mask is set to 0700 for security reasons. If you want to +# create files with group=rw permissions, set next parameter to 0775. + create mask = 0600 + +# Directory creation mask is set to 0700 for security reasons. If you want to +# create dirs. with group=rw permissions, set next parameter to 0775. + directory mask = 0700 + +# By default, \\server\username shares can be connected to by anyone +# with access to the samba server. +# The following parameter makes sure that only "username" can connect +# to \\server\username +# This might need tweaking when using external authentication schemes valid users = %S -[Transfer] - comment = Transfer - path = /data/samba/Transfer - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba +# Un-comment the following and create the netlogon directory for Domain Logons +# (you need to configure Samba to act as a domain controller too.) +;[netlogon] +; comment = Network Logon Service +; path = /home/samba/netlogon +; guest ok = yes +; read only = yes - # oplocks = yes | no - # - # oplock ist die Kurzform für opportunistischer Lock. - # Der Client speichert Dateien intern zwischen und schickt nicht - # jede Änderung gleich übers Netz. (Geschwindigkeitsvorteil). Sobald - # ein anderer Client auf die Daten zugreift, wird ein "oplock break" - # gesendet. Die Zwischengespeicherten Daten werden nun geschrieben und - # beide Clients greifen auf dieselben Daten zu. - # - oplocks = yes +# Un-comment the following and create the profiles directory to store +# users profiles (see the "logon path" option above) +# (you need to configure Samba to act as a domain controller too.) +# The path below should be writable by all users so that their +# profile directory may be created the first time they log on +;[profiles] +; comment = Users profiles +; path = /home/samba/profiles +; guest ok = no +; browseable = no +; create mask = 0600 +; directory mask = 0700 - # level2 oplocks = yes | no - # Ist ein "oplock break" gesendet worden werden keinerlei Zugriffe - # mehr zwischengespeichert. Wollen jedoch alle zugreifenden Clients - # nur lesen, so gibt es dafür keinen Grund. Mit diesem Parameter - # wird ermöglicht, daß lesende Zugriffe trotzdem zwischengespeichert - # werden - # - # !!!! Unix kennt keine solchen "schreibgeschützten Oplocks". Ist - # also "kernel oplocks" aktiviert, so kann die ganze Sache nicht - # funktionieren - # - # benötigt: oplocks = yes, kernel oplocks = no - # - level2 oplocks = yes - browseable = yes - read only = no - writeable = Yes +{% for item in samba_shares | default([]) %} + +[{{ item.name }}] + comment = {{ item.name }} + path = {{ item.path }} + + create mask = 0660 + force create mode = 0660 + directory mask = 2770 + force directory mode = 2770 - force group = +transfer # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @transfer + valid users = @{{ item.group_valid_users }} # allow to write - write list = @transfer + write list = @{{ item.group_write_list }} - create mask = 0664 - force create mode = 664 - directory mask = 2775 - force directory mode = 2775 + force group = +{{ item.group_write_list }} - ;vfs objects = vscan-clamav recycle - ;vscan-clamav: config-file = /usr/local/samba/lib/vscan-clamav.conf vfs objects = recycle recycle:keeptree = yes # touch access time from this file # note: this is not the modified time, which is # outdatet by ls-command # so yo can delete files older then n day with the following command: - # find /data/samba/share/bhoch3/.Trash -atime + -exec rm -rf {} \; + # find /data/samba/share//.Trash -atime + -exec rm -rf {} \; # recycle:touch = yes recycle:touch_mtime = no @@ -654,395 +353,37 @@ recycle:repository = .Trash/%U veto files = /.Trash/ -[Transfer-trash] - comment = Papierkorb (Transfer) - path = /data/samba/Transfer/.Trash +[{{ item.name }}-Trash] + comment = Papierkorb ({{ item.name }}) + path = {{ item.path }}/.Trash browseable = yes read only = yes -##[Archiv] -## comment = Archiv -## path = /data/samba/archiv -## ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv -## ;root postexec = umount /dev/md2 -## -## # oplocks = yes | no -## # -## # oplock ist die Kurzform für opportunistischer Lock. -## # Der Client speichert Dateien intern zwischen und schickt nicht -## # jede Änderung gleich übers Netz. (Geschwindigkeitsvorteil). Sobald -## # ein anderer Client auf die Daten zugreift, wird ein "oplock break" -## # gesendet. Die Zwischengespeicherten Daten werden nun geschrieben und -## # beide Clients greifen auf dieselben Daten zu. -## # -## oplocks = yes -## -## # level2 oplocks = yes | no -## # Ist ein "oplock break" gesendet worden werden keinerlei Zugriffe -## # mehr zwischengespeichert. Wollen jedoch alle zugreifenden Clients -## # nur lesen, so gibt es dafür keinen Grund. Mit diesem Parameter -## # wird ermöglicht, daß lesende Zugriffe trotzdem zwischengespeichert -## # werden -## # -## # !!!! Unix kennt keine solchen "schreibgeschützten Oplocks". Ist -## # also "kernel oplocks" aktiviert, so kann die ganze Sache nicht -## # funktionieren -## # -## # benötigt: oplocks = yes, kernel oplocks = no -## # -## level2 oplocks = yes -## -## browseable = yes -## read only = no -## writeable = Yes -## -## force group = +archive -## -## # can login into that share -## valid users = @users -## # allow to write -## write list = @archive -## -## create mask = 664 -## directory mask = 2775 +{% endfor %} -[Verwaltung] - comment = Verwaltung - path = /data/samba/Verwaltung - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv +;[printers] +; comment = All Printers +; browseable = no +; path = /var/spool/samba +; printable = yes +; guest ok = no +; read only = yes +; create mask = 0700 - browseable = yes - read only = no - writeable = Yes +# Windows clients look for this share name as a source of downloadable +# printer drivers +;[print$] +; comment = Printer Drivers +; path = /var/lib/samba/printers +; browseable = yes +; read only = yes +; guest ok = no +# Uncomment to allow remote administration of Windows print drivers. +# You may need to replace 'lpadmin' with the name of the group your +# admin users are members of. +# Please note that you also need to set appropriate Unix permissions +# to the drivers directory for these users to have write rights in it +; write list = root, @lpadmin - force group = +verwaltung - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @verwaltung - # allow to write - write list = @verwaltung - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - - ;vfs objects = vscan-clamav recycle - ;vscan-clamav: config-file = /usr/local/samba/lib/vscan-clamav.conf - vfs objects = recycle - recycle:keeptree = yes - # touch access time from this file - # note: this is not the modified time, which is - # outdatet by ls-command - # so yo can delete files older then n day with the following command: - # find /data/samba/share/bhoch3/.Trash -atime + -exec rm -rf {} \; - # - recycle:touch = yes - recycle:touch_mtime = no - recycle:versions = yes - recycle:maxsize = 10485760 # around 10MB - recycle:exclude = *.tmp,*.temp,*.o,*.obj,~$*,*.~?? - recycle:excludedir = /tmp,/temp,/cache,.Trash - recycle:repository = .Trash/%U - veto files = /.Trash/ - - -[Verwaltung-trash] - comment = Papierkorb (Verwaltung) - path = /data/samba/Verwaltung/.Trash - - browseable = yes - read only = yes - - -[Scans] - comment = Scans - path = /data/samba/Scans - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +scans - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @scans - # allow to write - write list = @scans - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[Buero_Scans] - comment = Scans Buero - path = /data/samba/Scans/Buero_Scans - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +scans - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @scans - # allow to write - write list = @scans - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[Frauke_Scans] - comment = Scans Frauke - path = /data/samba/Scans/Frauke_Scans - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +scans - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @scans - # allow to write - write list = @scans - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[FSJ_Scans] - comment = Scans FSJ - path = /data/samba/Scans/FSJ_Scans - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +scans - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @scans - # allow to write - write list = @scans - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[Jibran_Scans] - comment = Scans Jibran - path = /data/samba/Scans/Jibran_Scans - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +scans - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @scans - # allow to write - write list = @scans - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[Julia_Scans] - comment = Scans Julia - path = /data/samba/Scans/Julia_Scans - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +scans - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @scans - # allow to write - write list = @scans - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[Maica_scans] - comment = Scans Maica - path = /data/samba/Scans/Maica_scans - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +scans - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @scans - # allow to write - write list = @scans - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[Thomas_Scans] - comment = Scans Thomas - path = /data/samba/Scans/Thomas_Scans - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +scans - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @scans - # allow to write - write list = @scans - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[Kamera] - comment = Kamera - path = /data/samba/Kamera - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +intern - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @intern - # allow to write - write list = @intern - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - -[Install] - comment = Install - path = /data/samba/Install - ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv - - browseable = yes - read only = no - writeable = Yes - - force group = +intern - - # can login into that share - ;valid users = chris,jonas,anna,ralf,annika,frauke - valid users = @intern - # allow to write - write list = @intern - - force create mode = 660 - create mask = 0660 - force directory mode = 2775 - directory mask = 2775 - - -## - # Un-comment the following and create the netlogon directory for Domain Logons -## - # (you need to configure Samba to act as a domain controller too.) -## - ;[netlogon] -## - ; comment = Network Logon Service -## - ; path = /home/samba/netlogon -## - ; guest ok = yes -## - ; read only = yes -## - -## - # Un-comment the following and create the profiles directory to store -## - # users profiles (see the "logon path" option above) -## - # (you need to configure Samba to act as a domain controller too.) -## - # The path below should be writable by all users so that their -## - # profile directory may be created the first time they log on -## - ;[profiles] -## - ; comment = Users profiles -## - ; path = /home/samba/profiles -## - ; guest ok = no -## - ; browseable = no -## - ; create mask = 0600 -## - ; directory mask = 0700 -## - -## - [printers] -## - comment = All Printers -## - browseable = no -## - path = /var/spool/samba -## - printable = yes -## - guest ok = no -## - read only = yes -## - create mask = 0700 -## - -## - # Windows clients look for this share name as a source of downloadable -## - # printer drivers -## - [print$] -## - comment = Printer Drivers -## - path = /var/lib/samba/printers -## - browseable = yes -## - read only = yes -## - guest ok = no -## - # Uncomment to allow remote administration of Windows print drivers. -## - # You may need to replace 'lpadmin' with the name of the group your -## - # admin users are members of. -## - # Please note that you also need to set appropriate Unix permissions -## - # to the drivers directory for these users to have write rights in it -## - ; write list = root, @lpadmin -## - -## - # A sample share for sharing your CD-ROM with others. -## - ;[cdrom] -## - ; comment = Samba server's CD-ROM -## - ; read only = yes -## - ; locking = no -## - ; path = /cdrom -## - ; guest ok = yes -## - -## - # The next two parameters show how to auto-mount a CD-ROM when the -## - # cdrom share is accesed. For this to work /etc/fstab must contain -## - # an entry like this: -## - # -## - # /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0 -## - # -## - # The CD-ROM gets unmounted automatically after the connection to the -## - # -## - # If you don't want to use auto-mounting/unmounting make sure the CD -## - # is mounted on /cdrom -## - # -## - ; preexec = /bin/mount /cdrom -## - ; postexec = /bin/umount /cdrom -## - diff --git a/roles/common/templates/etc/samba/smb.conf.j2.BAK b/roles/common/templates/etc/samba/smb.conf.j2.BAK new file mode 100644 index 0000000..19374cc --- /dev/null +++ b/roles/common/templates/etc/samba/smb.conf.j2.BAK @@ -0,0 +1,1048 @@ +# This is the main Samba configuration file. You should read the +# smb.conf(5) manual page in order to understand the options listed +# here. Samba has a huge number of configurable options (perhaps too +# many!) most of which are not shown in this example +# +# For a step to step guide on installing, configuring and using samba, +# read the Samba HOWTO Collection. +# +# Any line which starts with a ; (semi-colon) or a # (hash) +# is a comment and is ignored. In this example we will use a # +# for commentry and a ; for parts of the config file that you +# may wish to enable +# +# NOTE: Whenever you modify this file you should run the command "testparm" +# to check that you have not made any basic syntactic errors. +# + +#======================= Globale Einstellungen ===================================== + +[global] + + # workgroup = name + # + # Der Sambaserver wird Mitglied der Arbeitsgruppe "name". + # Diese Gruppenzuordnung ist sehr lose. jedeR kann in die + # Gruppe ein- oder austreten ohne irgendwelche + # Sicherheitskriterien zu erfüllen. Anders als bei den + # Domänen. + # !! Bei aktivierter Domänenfunktion wird dieser Parameter + # Domänname verwendetals !! + # + ## aktuell: workgroup = workgroup + ;workgroup = Aktionsbuendnis + workgroup = WORKGROUP + + # netbios=name + # + # NetBIOS ist im Gegensatz zu DNS ein flacher Namensraum + # ohne Hirarchie. + # Diese Namen werden vollkommen dynamisch vergeben. Bootet + # ein (Windows)-Rechner, so versucht er seinen eigen + # NetBIOS-Namen zu reservieren. existiert dieser schon, so + # hat der neue Rechnwer Pech gehabt und kann nicht am Netzwerk + # teilnehmen. + # Damit wird für den Server "name" registriert. Unter diesem + # ist er für die Sambaclients ansprechbar. + # NetBIOS-Namen sind nicht unbedingt nur auf Computer anwendbar. + # Auch angemeldete Benutzer und Computergruppen können mit + # NetBIOS-Namen angesprochen werden. + # + ## aktuell: netbios name = anita + netbios name = FILE + + name resolve order = lmhosts wins bcast host + + # server string = name + # + # Die Kommentarzeile des Servers. + # + ## aktuell: server string = anita + server string = File Server ( Samba %v ) + + # kernel oplocks = yes | no + # oplock ( opportunistischer Lock) auf betriebssystemebene. + # In der Regel werden Daten ( Dateien ) zwischengespeichert + # und nicht jede Änderung gleich geschrieben. Samba kann intern + # (Parameter oplock einer Freigabe s.u.) davon gebrauch machen. + # Mit "kernel oplocks" kann dies auch auf Betriebssystemebene + # eingestellt werden. Es kann also sowohl per Samba als auch etwa + # direkt unter Unix/Linux oder NFS zugegriffen werden ohne auf + # die Geschwindigkeitsvorteile des Oplocks zu verzichten. + # Standardmäßig ist dieser Parameter aktiviert, sofern das + # Betriebssystem dies unterstützt (derzeit IRIX und Linux + # Kernel 2.4) + # + # !!! soll "level2 oplocks" aktiviert werden, so darf muß + # "kernel oplocks" deaktiviert werden. (s.u.) + # + ## aktuell: kernel oplocks = yes + kernel oplocks = no + + # oplock break wait time = + # Dies ist (eigentlich) ein Tuning-Parameter, der aufgrund + # von fehlerhaften Windowsbetriebssystemen aufgenommen wurde: + # Antwortet Samba zu schnell auf Anfragen, die einen "oplock break + # request" zur Folge haben können, so kann die Verbindung fehlschlagen + # und der client antwortet nicht auf den break request. Mit diesem + # Parameter wird Samba angewiesen die angegebene Zeit (in Millisekunden) + # zu warten, bevor ein oplock break request gesendet wird. + # Standardeinstellung: oplock break wait time = 0 + # + # by the way: + # SMB, steht für Server Message Block, und ist ein Protokoll + # welches die gemeinsame Benutzung von Dateien, Druckern, + # seriellen Ports, auch "named pipes" und "mail slots" zwischen + # Computern erlaubt. + # 2002-09-24 ch: fix oplock break prob? + oplock break wait time = 10 + + # deadtime = n + # nach n Minuten Inakrivität wird die Verbindung + # unterbrochen. + # + deadtime = 0 + + # keepalive = n + # überprüft alle n Sekunden, ob ein client noch erreichbar + # ist (ob er überhaupt noch lebt ). Wenn nicht, geht der + # Server davon aus, daß der client abgeschaltet oder abgestürzt + # ist und beendet die Verbindung. + # !! Besser ist es, dies nicht auf Samba-Ebene sondern auf + # Verbindungsebene zu regeln ( mit "socket options") + # + ## aktuell: keepalive = 30 + keepalive = 0; + + # socket options = OPTIONS + # + # TCP_NODELAY + # ist standardmäßig aktiviert. Pakete werden + # sofort abgeschickt. Normalerweise wird bei + # kleinen Datenmengen gewartet bis "genügend" + # Daten zusammen sind damit es sich lohnt diese + # übers Netz zu schicken. + # + # SO_KEEPALIVE + # Bei TCP-Verbindungen wird mit dieser Option + # erreicht, daß die Gegenstelle der Verbindung + # auf Erreichbarkeit und Funktionsbereitschaft + # überprüft wird. Ist dies nicht der Fall, so + # wird die Verbindung beendet + # + # SO_BROADCAST + # Erlaubt das Versenden von Broadcast-Meldungen an + # das gesamte Netzwerk. + # + # SO_REUSEADDR + # Erlaubt die Weiterverwendung von Socketadressen + # + # IPTOS_LOWDELAY + # IPTOS_THROUGHPUT + # Diese beiden Optionen sind fuer das routing. Soll die + # direkte (IPTOS_LOWDELAY) oder die mit mehr Bandbreite + # (IPTOS_THROUGHPUT) benutz werden ? Die meisten Router + # reagieren auf die entsprechenden Einträge in den + # Paketheadern nicht, so sind diese Socketoptionen meistens + # sinnlos + # + # SO_SNDBUF = + # der Sendepuffer kann mit dieser Option gesetzt werden + # Bemerkung: siehe SO_RCVBUF + # + # SO_RCVBUF = + # Der Empfangspuffer kann mit dieser Option gesetzt werden + # Bemerkung: + # Mit den beiden Optionen SO_SNDBUF und SO_RCVBUF kann der + # letzte Schliff in die Konfiguration gebracht werden. Wer + # aber nicht wirklich ein Geschwindigkeitsfanatiker ist, + # sollte die Finger davon lassen + # + # SO_SNDLOWAT = + # SO_RCVLOWAT = + # Diese beiden Parameter definieren, wievile Daten vorhanden sein + # müssen, damit sie vom socket weitergeleitet werden. Auch dies + # sollte gelassen werdewn wie es ist. Unter Linux kann das + # Verhalten gar nicht verändert werdeb + # + ## aktuell: socket options = SO_KEEPALIVE IPTOS_LOWDELAY TCP_NODELAY + socket options = TCP_NODELAY + + # security = share | user | server | domain + # + # Mit diesem Parameter wird der Sicherheitsmodus eingestellt. Es + # wird das "security mode bit" gesetzt. Es werden zur Zeit die vier + # unten aufgelisteten Modi unterstütz. + # + # share die Authentifizierung erfolgt auf Freigabeebene. Beim Einloggen + # Server wird noch keine Überprüfungen vorgenommen. Erst zum + # das Verbinden mit einer Freigabe ist ein Passwort (kein + # Benutzername) erforderlich. Windows sendet trotzdem ein + # Benutzername mit. Für Authentifizierung werden foldende + # Benutzer verwendet + # - wird ein benutzername mitgesendet wird zunächst dieser + # zur Anmeldung benutzt. + # - ist der rechner bereits beim Sambaserver angemeldet wird + # der hierbei verwendete Name benutzt + # - danach wird der Name der Freigabe benutzt + # - als nächstes wird der NetBIOS_Name des Clients versucht + # - schließlich werden die in der "username"_liste der Freigabe + # aufgeführten Namen versucht + # - falls der "guest ok" Parameter gesetzt, alle anderen + # Anmeldungen fehlschlugen, wird der "guest account" Name + # verwendet. + # + # user Bevor sich ein Client mit dem Server verbinden kann, muß er + # sich mit Benutzernamen und Passwort authentifizieren. Erst + # wenn dies erfolgreich war, wird die Liste der verfügbaren + # Freigaben gesendet + # + # server Dieser Modus funktioniert im Prinzip we der user-Modus. + # Allerdings wird zunächst ein anderer SMB-Server nach + # Benutzernamen und Passwort befragt (password server = Computername). + # Erst wenn dies fehlschlägt, wird in der eigenen Datenbank + # nachgeschaut. Dieser Modus ist durch den domain-Modus überholt. + # + # domain Ähnlich wie beim server-Modus wird auf die Benutzerauthentufizierung + # eines anderen Servers vertraut. Anders als beim server-Modus + # wird das NT-Domain-Sicherheitsprotokoll unterstützt. Das + # bedeute, daß auch Benutzer aus vertrauten Domänen der Zugang + # gestattet werden kann. + # + security = user + + + # encrypt passwords = yes | no + # aktiviert die Passwortverschlüsselung (= yes). Damit ist zwar + # die Verschlüsselung aktiviert, aber weil Microsoft eine andere + # Verschlüssellungsroutine benutzt als Linux, können die + # Linux-Paßwortdateien ("passwd","shadow" oder die NIS-Datenbank + # nicht benutzt werden. Samba benötigt eine eigene Paßwortdatei, + # üblicherweise heißt sie "smbpasswd" und liegt im private-Verzeichnis + # der Sambainstallation (s.u. parameter "smb passwd file") + # + encrypt passwords = true + + passdb backend = smbpasswd + + + # smb passwd file = Dateiname + # Gibt den Ort und Namen der Samba-Paßwortdatei an. Diese wird benötigt + # wenn Paßwortverschlüsselung benutzt wird. + # + # !!! Die Paßwotdatei und die darin befindlichen Hashwerte sind angreifbar. + # Sie sollte dem user "root" gehören und nur von ihm lesbar, beschreibbar + # und ausführbar sein. (chmod 700) + # + # benötigt: encrypt passwords = yes + # + ## aktuell: /etc/samba/smbpasswd + #smb passwd file = /usr/local/samba/private/smbpasswd + smb passwd file = /etc/samba/smbpasswd + + + # unix password sync = yes | no + # Wenn Kennwörter durch den Client oder durch das Passwortprogramm + # smbpasswd geändert werden, so müßte anschließend auch das "normale" + # unix-Passwort geändert werden, wenn nicht mit zwei verschiedenen + # Kennwörtenr gearbeitet werden soll. Das läßt sich durch diesen + # Parameter (yes) ändern. Falls dieser Parameter aus Yes eingestellt + # ist, wird das in dem Parameter "passwd program" angegebene Programm + # als ROOT aufgerufen, um zu erlauben, das neue Passwort zu setzen ohne + # das alte angeben zu müssen. + # + ## aktuell: unix password sync = no + unix password sync = yes + + + # passwd program = Dateinme + # Dieser Parameter gibt den Ort und Namen des Programms an, mit dem + # das UNIX-Passwort geändert werden kann (i.allg. /bin/passwd oder + # /usr/bin/passwd). Diese Programm wird als root ausgeführt und weiß + # nicht, für welchen Namen das Passwort geändert werden soll. Daher + # sollte diesem mit dem Makro %u der Benutzername übergeben werden. + # + # Beachte: Passwortprogramme sind i.d.R. interaktive Programme. Die + # Unterhaltung (Chat) muß mit Hilfe des Parameters "passwd chat" + # konfiguriert werden (s.u.). + # + # benötigt: unix password sync = yes + # + ## aktuell: passwd program = /bin/passwd + passwd program = /usr/bin/passwd %u + + + # passwd chat = "Ausgabestring" "Eingabestring" + # [ "Ausgabestring" "Eingabestring" ] [...] + # + # Mit den anzugebenden Zeichenketten wird die Unterhaltung zwischen + # dem passwd-Programm und dem smbd beim Ändern des Passwortes + # konfiguriert (eine oder mehrere aufeinanderfolgende Aus- und + # Eingabepaare). Die Ein- und Ausgabestrings sind durch ein Leerzeichen + # voneinader getrennt. Der Ausgabeteil besteht aus dem Text, welches das + # passwd-Programm ausgibt. Dabei ist es möglich, das Jokerzeichen "*", + # welches für eine beliebige auch 0-Zeichen lange Zeichenkette steht. + # Der Eingabeteil sind die Eingaben, die das passwd-Programm benötigt. + # Hierbei wird "%o" für das alte (wir in der Regel nicht gebraucht, da + # das passwd-Programm als user "root" aufgerufen wird und somit das alte + # Passwort nicht benötigt wird) und "%n" für das neue Passwort verwendet. + # Ferner können folgende Escapesequenzen benutzt werden: + # /n Zeilenvorschub + # /r Wagenrücklauf + # /t Tabulator + # /s Leerzeichen + # + # beachte:Ein String kann durch doppelte Anführungszeichen + # "zusammengehalten" werden. Um Leerzeichen in Passwörten + # zu ermöglichen sollten in der Chat-Zeile "%n" und "%o" durch + # doppelte Anführungszeichen geschützt werden. + # + # Das Chat-script ist case-sensitiv + # + # benötigt: unix password sync = yes + # + # Für Red Hat 7.2: + # passwd chat = *asswor*\n* "%n"\n *asswor* "%n"\n *success* + # + #passwd chat = *new*password* "%n"\n **new*password* "%n"\n *success* + passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . + + # guest account = + # Mit diesem Parameter werden Gastzugriffe einem echten + # Unix-Benutzer zugeordnet. ( Freigabe Parameter guset = ok + # oder guest only = yes) + # Standardeinstellung: guest account = nobody + # + ## aktuell: guest account = nobody + ; guest account = nobody + + # guest ok = yes |no + # Soll eine Freigabe auch für Gäste zugänglich sein, so ist dieser + # Parameter auf "yes" zu setzen + # + guest ok = no + + # map to guest = Never | Bad User | Bad Passwort + # Mit diesem Parameter wird eingestellt, was mit Anfrgaen + # passeirt, die keinen Benutzern und kein gültiges + # Passwort besitzen + # + # Never + # Requests mit ungültigem Passwort werden zurückgewiesen. Es + # werden noch nichteinmal die Freigaben gezeigt. + # (Standardeinstellung) + # + # Bad User + # Benutzer mit faslchem Passwort werden zurückgewiesen. Bei + # unbekanntem Benutzer wird auf den "guest account" gemappt + # + # Bad Password + # Benutzer mit falschem Passwort werden auf den "guest account" + # gemappt. + # VORSICHT: + # der Benutzer erkennt dies nicht und weiß somit + # nicht mit welchen Rechten er auf den Server zufreift. + # Das kann zu Verwirrungen führen. + # + ## aktuell: map to guest = Bad User + map to guest = Never + + # username map = + # Wenn auf den Windows-Clients ein Usere unter anderem Namen + # Auftritt als auf dem Samba-Server, so bietet sich eine Datei + # für die Zuordnung an + # Bsp.: + # root = admin administrator + # weist den usernamen admin oder administraor den unixnamen + # root zu + ; username map = /usr/local/samba/lib/users.map + + # hide files = [DateiOderVerzeichnis[/andereDateiOderVerzeichnis[/... + # Mir diesem Parameter kann eine Liste von Dateien und/oder + # Verzeichnissen angegeben werden, die nicht angezeigt werden + # sollen (hidden Attribut wird gesetzt). Die einzelnen + # Dateien/Verzeichnisse werden durch ein Slash "/" getrennt und + # können Wildcards "*" und "?" enthalten, nicht aber den Slash + # selbst. Die Eintraege mussen den UNIX Dateinamenkonventionen + # gehorchen. + # + ## aktuell: hide files = /DesktopFolderDB/TrashFor%m/resource.frk/Icon%0D/ + hide files = /.*/DesktopFolderDB/TrashFor%m/resource.frk/ + + # default case = upper | lower + # Standardschreibweise für neu angelegte Dateien + # Standardeinstellung: default case = lower + # + defaultcase = lower + + # preserve case = yes | no + # Mit diesem Parameter kann festgelegt werden, ob bei neu angelegte + # Dateien die Klein/Großschreibung des Clienten beibehalten + # wird (yes) oder die Standardeinstellung (Parameter "default case") + # benutzt wird (no). + # + preserve case = yes + + # short preserve case = yes | no + # Wie Parameter "preserve case" jedoch nur gültig für kurze + # im DOS-Format 8.3 gehaltene Dateien + # + short preserve case = yes + + # dos charset = + # Mit dieser Option wird der Zeichensatz eingestellt, mit dem Samba zu + # den DOS-Clienten sprechen soll + # Standardeinstellung: hängt von den installierten Zeichensätzen ab. Samba + # versucht den Zeichensatz 850 zu benutzen. Ist dieser nicht vorhanden, wird + # der ASCII Zeichensatz genommen. + # + dos charset = CP850 + + # unix charset = + # Gibt an, welchen Zeichensatz Samba (auf der Unix Maschine) benutzen soll. + # Diese Angabe wird benötigt, damit Samba weiß, wie es text für die clients konvertieren muß + # Standardeinstellung: unix charset = UTF8 + # + ##unix charset = ISO-8859-1 + unix charset = UTF8 + + # display charset = + # Zeichensatz den Sammba für Ausgaben auf stdout, stderr und für SWAT + # benutzt. Sollte der gleiche wie für den Parameter "unix charset" + # sein. + # Standardeinstellung: display charset = ASCII + # + ##display charset = ISO-8859-1 + #display charset = UTF8 + + + # valid chars + # In Samba 3.x nicht mehr verfügbar + ## aktuell valid chars = 0224:0231 0204:0216 0201:0232 + + # character set = + # In Samba 3.x nicht mehr verfügbar + ## aktuell: character set = ISO8859-15 + + # client code page = + # In Samba 3.x nicht mehr verfügbar + ## aktuell: client code page = 850 + + + os level = 50 + local master = yes + preferred master = yes + domain master = yes + + # wins support = yes | no + # Ist dieser Parameter auf yes, so übernimmt der nmbd die + # Funktion eines WINS-Servers. Die Datenbankdatei mit dem + # namen wins.dat (ascii-format) wird im lock-Verzeichnis + # gespeichert + # Standardeinstellung: wins support = no + # + # !! VORSICHT !! + # Es kann immer nur ein Samba-Server wins support aktiviert + # haben. Andernfalls kan es zu großen Problemen kommen. + #wins support = Yes + + # If you want Samba to use an existing wins server, please uncomment the + # following line and replace the dummy with the wins server's ip number. + ;wins server = 192.168.52.1 + + + + + # log file = + # Dieser Parameter erlaibt es, eine alternative Log-Datei + # anzulegen. (Die einkompilierten Angaben werden dabei + # Überschrieben). Durch Makros wird es möglich, für jeden + # Nutzer oder jede Maschine seperate Log_dateien zu schreiben: + # log file = /log.%u legt für jeden + # User eine eigene Protokolldatei an. + # + ## aktuel: deaktiviert + # + # für jede Maschine ein eigenes log-file + log file = /var/log/samba/%m.log + + # log level = 0-10 | 100 + # Dieser Parameter spezifiziert, wie ausführlich die Meldungen + # von Samba sein sollen. (0 nur kritische Fehlermeldungen) + # Der Wert 100 spielt eine besondere Rolle. err speichert die + # während der Authetifizierung verwendeten Passworte + # + ## aktuell: log level = 2 + log level = 2 + + # max log size (G) + # + # Gibt die Größe (in Kilobyte) an, bis zu der die Logfiles + # wachsen dürfen. + # Samba überprüft regelmäßig die Größe. Falls das angegebene + # Maximum überschritten ist, wird der Logdatei die Endung .old + # angehangen und eine neue angelegt. + # + # A size of 0 means no limit. + # + # Default: max log size = 5000 + # + # Example: max log size = 1000 + # + max log size = 5000 + + ## - To use the CUPS printing interface set + ## - printcap name = cups + ## - + ## - This should be supplemented by an addtional setting + ## - printing = cups + ## - + #printcap name = /etc/printcap + printcap name = cups + printing = cups + + ## - A boolean variable that controls whether all printers in the + ## - printcap will be loaded for browsing by default. + ## - + ## - Default: load printers = yes + ## - + load printers = Yes + + # interfaces = IP-Adress/Subnetzmaske[ IP-Adress/Subnetzmaske... + # Dieser Parameter gibt das bzw. die Netzwerk(e) an, die Samba + # verwendet. + # Standard: erstes gefundenes Netzwerk und 127.0.0.1 + # + # !! VORSICHT !! + # eben die Standardeinstellung kann zum Problem werden, da + # Samba häufig das Dummy-Device als solches erkennt. Auch wenn + # nur ein Netzwerk installiert ist, ist es also sinnvoll, diesen + # Parameter zu verwendn + # + ;interfaces = eth0 192.168.82.10/24 lo 127.0.0.1/8 + interfaces = {{ ansible_default_ipv4.address }}/24 127.0.0.1/8 + + hosts deny = 0.0.0.0/0 + hosts allow = 192.168.0.0/16 10.0.0.0/8 127.0.0.0/8 + + # bindet nur an die im Parameter "interfaces" angegebenen Adressesn + # + # !! VORSICHT !! + # Wenn "bind interfaces only" gesetzt ist und die Netzwerkadresse + # 127.0.0.1 nicht im Parameter "interfaces" mit angegeben ist, dann + # arbeiten "smppasswd" und "swat" nicht wie erwartet. + # (siehe auch manpage smb.conf) + # + bind interfaces only = Yes + + local master = yes + prefered master = yes + domain master = yes + time server = yes + + + +# Do you wan't samba to act as a logon-server for your windows 95/98 +# clients, so uncomment the following: + domain logons = NO +# For a specific logon script per user +; logon script = %U.bat +# For a specific logon script per machine +; logon script = %m.bat + +# Where to store the logon scripts. +;[netlogon] +; comment = Network Logon Service +; path = /var/lib/samba/netlogon + +# Where profiles of Windows 9x systems are stored. +# First example for a centralized place. +; logon home = \\%L\profiles\%U +# Second example for a subdirectory of the users home. +; logon home = \\%L\%U\profile +# Where profiles of Windows NT systems are stored. +; logon path = \\%L\profiles\%U + + + +#============================ Freigaben ============================== + +# Extra share for profiles. Default is the home of the user. +#[profiles] +# comment = Network Profiles Service +# path = /var/lib/samba/profiles +# browseable = No + +[homes] + comment = Home Directories + read only = No + create mask = 0640 + directory mask = 0750 + browseable = No + + # By default, \\server\username shares can be connected to by anyone + # with access to the samba server. + # The following parameter makes sure that only "username" can connect + # to \\server\username + # This might need tweaking when using external authentication schemes + valid users = %S + + +[Transfer] + comment = Transfer + path = /data/samba/Transfer + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba + + # oplocks = yes | no + # + # oplock ist die Kurzform für opportunistischer Lock. + # Der Client speichert Dateien intern zwischen und schickt nicht + # jede Änderung gleich übers Netz. (Geschwindigkeitsvorteil). Sobald + # ein anderer Client auf die Daten zugreift, wird ein "oplock break" + # gesendet. Die Zwischengespeicherten Daten werden nun geschrieben und + # beide Clients greifen auf dieselben Daten zu. + # + oplocks = yes + + # level2 oplocks = yes | no + # Ist ein "oplock break" gesendet worden werden keinerlei Zugriffe + # mehr zwischengespeichert. Wollen jedoch alle zugreifenden Clients + # nur lesen, so gibt es dafür keinen Grund. Mit diesem Parameter + # wird ermöglicht, daß lesende Zugriffe trotzdem zwischengespeichert + # werden + # + # !!!! Unix kennt keine solchen "schreibgeschützten Oplocks". Ist + # also "kernel oplocks" aktiviert, so kann die ganze Sache nicht + # funktionieren + # + # benötigt: oplocks = yes, kernel oplocks = no + # + level2 oplocks = yes + + browseable = yes + read only = no + writeable = Yes + + force group = +transfer + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @transfer + # allow to write + write list = @transfer + + create mask = 0664 + force create mode = 664 + directory mask = 2775 + force directory mode = 2775 + + ;vfs objects = vscan-clamav recycle + ;vscan-clamav: config-file = /usr/local/samba/lib/vscan-clamav.conf + vfs objects = recycle + recycle:keeptree = yes + # touch access time from this file + # note: this is not the modified time, which is + # outdatet by ls-command + # so yo can delete files older then n day with the following command: + # find /data/samba/share/bhoch3/.Trash -atime + -exec rm -rf {} \; + # + recycle:touch = yes + recycle:touch_mtime = no + recycle:versions = yes + recycle:maxsize = 10485760 # around 10MB + recycle:exclude = *.tmp,*.temp,*.o,*.obj,~$*,*.~?? + recycle:excludedir = /tmp,/temp,/cache,.Trash + recycle:repository = .Trash/%U + veto files = /.Trash/ + +[Transfer-trash] + comment = Papierkorb (Transfer) + path = /data/samba/Transfer/.Trash + + browseable = yes + read only = yes + +##[Archiv] +## comment = Archiv +## path = /data/samba/archiv +## ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv +## ;root postexec = umount /dev/md2 +## +## # oplocks = yes | no +## # +## # oplock ist die Kurzform für opportunistischer Lock. +## # Der Client speichert Dateien intern zwischen und schickt nicht +## # jede Änderung gleich übers Netz. (Geschwindigkeitsvorteil). Sobald +## # ein anderer Client auf die Daten zugreift, wird ein "oplock break" +## # gesendet. Die Zwischengespeicherten Daten werden nun geschrieben und +## # beide Clients greifen auf dieselben Daten zu. +## # +## oplocks = yes +## +## # level2 oplocks = yes | no +## # Ist ein "oplock break" gesendet worden werden keinerlei Zugriffe +## # mehr zwischengespeichert. Wollen jedoch alle zugreifenden Clients +## # nur lesen, so gibt es dafür keinen Grund. Mit diesem Parameter +## # wird ermöglicht, daß lesende Zugriffe trotzdem zwischengespeichert +## # werden +## # +## # !!!! Unix kennt keine solchen "schreibgeschützten Oplocks". Ist +## # also "kernel oplocks" aktiviert, so kann die ganze Sache nicht +## # funktionieren +## # +## # benötigt: oplocks = yes, kernel oplocks = no +## # +## level2 oplocks = yes +## +## browseable = yes +## read only = no +## writeable = Yes +## +## force group = +archive +## +## # can login into that share +## valid users = @users +## # allow to write +## write list = @archive +## +## create mask = 664 +## directory mask = 2775 + + +[Verwaltung] + comment = Verwaltung + path = /data/samba/Verwaltung + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +verwaltung + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @verwaltung + # allow to write + write list = @verwaltung + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + + ;vfs objects = vscan-clamav recycle + ;vscan-clamav: config-file = /usr/local/samba/lib/vscan-clamav.conf + vfs objects = recycle + recycle:keeptree = yes + # touch access time from this file + # note: this is not the modified time, which is + # outdatet by ls-command + # so yo can delete files older then n day with the following command: + # find /data/samba/share/bhoch3/.Trash -atime + -exec rm -rf {} \; + # + recycle:touch = yes + recycle:touch_mtime = no + recycle:versions = yes + recycle:maxsize = 10485760 # around 10MB + recycle:exclude = *.tmp,*.temp,*.o,*.obj,~$*,*.~?? + recycle:excludedir = /tmp,/temp,/cache,.Trash + recycle:repository = .Trash/%U + veto files = /.Trash/ + + +[Verwaltung-trash] + comment = Papierkorb (Verwaltung) + path = /data/samba/Verwaltung/.Trash + + browseable = yes + read only = yes + + +[Scans] + comment = Scans + path = /data/samba/Scans + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +scans + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @scans + # allow to write + write list = @scans + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[Buero_Scans] + comment = Scans Buero + path = /data/samba/Scans/Buero_Scans + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +scans + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @scans + # allow to write + write list = @scans + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[Frauke_Scans] + comment = Scans Frauke + path = /data/samba/Scans/Frauke_Scans + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +scans + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @scans + # allow to write + write list = @scans + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[FSJ_Scans] + comment = Scans FSJ + path = /data/samba/Scans/FSJ_Scans + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +scans + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @scans + # allow to write + write list = @scans + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[Jibran_Scans] + comment = Scans Jibran + path = /data/samba/Scans/Jibran_Scans + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +scans + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @scans + # allow to write + write list = @scans + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[Julia_Scans] + comment = Scans Julia + path = /data/samba/Scans/Julia_Scans + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +scans + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @scans + # allow to write + write list = @scans + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[Maica_scans] + comment = Scans Maica + path = /data/samba/Scans/Maica_scans + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +scans + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @scans + # allow to write + write list = @scans + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[Thomas_Scans] + comment = Scans Thomas + path = /data/samba/Scans/Thomas_Scans + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +scans + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @scans + # allow to write + write list = @scans + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[Kamera] + comment = Kamera + path = /data/samba/Kamera + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +intern + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @intern + # allow to write + write list = @intern + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + +[Install] + comment = Install + path = /data/samba/Install + ;root preexec = mount /dev/md1 /data ; mount /dev/md2 /data/samba ; chown sysadm:sysadm /data/samba/archiv + + browseable = yes + read only = no + writeable = Yes + + force group = +intern + + # can login into that share + ;valid users = chris,jonas,anna,ralf,annika,frauke + valid users = @intern + # allow to write + write list = @intern + + force create mode = 660 + create mask = 0660 + force directory mode = 2775 + directory mask = 2775 + + +## - # Un-comment the following and create the netlogon directory for Domain Logons +## - # (you need to configure Samba to act as a domain controller too.) +## - ;[netlogon] +## - ; comment = Network Logon Service +## - ; path = /home/samba/netlogon +## - ; guest ok = yes +## - ; read only = yes +## - +## - # Un-comment the following and create the profiles directory to store +## - # users profiles (see the "logon path" option above) +## - # (you need to configure Samba to act as a domain controller too.) +## - # The path below should be writable by all users so that their +## - # profile directory may be created the first time they log on +## - ;[profiles] +## - ; comment = Users profiles +## - ; path = /home/samba/profiles +## - ; guest ok = no +## - ; browseable = no +## - ; create mask = 0600 +## - ; directory mask = 0700 +## - +## - [printers] +## - comment = All Printers +## - browseable = no +## - path = /var/spool/samba +## - printable = yes +## - guest ok = no +## - read only = yes +## - create mask = 0700 +## - +## - # Windows clients look for this share name as a source of downloadable +## - # printer drivers +## - [print$] +## - comment = Printer Drivers +## - path = /var/lib/samba/printers +## - browseable = yes +## - read only = yes +## - guest ok = no +## - # Uncomment to allow remote administration of Windows print drivers. +## - # You may need to replace 'lpadmin' with the name of the group your +## - # admin users are members of. +## - # Please note that you also need to set appropriate Unix permissions +## - # to the drivers directory for these users to have write rights in it +## - ; write list = root, @lpadmin +## - +## - # A sample share for sharing your CD-ROM with others. +## - ;[cdrom] +## - ; comment = Samba server's CD-ROM +## - ; read only = yes +## - ; locking = no +## - ; path = /cdrom +## - ; guest ok = yes +## - +## - # The next two parameters show how to auto-mount a CD-ROM when the +## - # cdrom share is accesed. For this to work /etc/fstab must contain +## - # an entry like this: +## - # +## - # /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0 +## - # +## - # The CD-ROM gets unmounted automatically after the connection to the +## - # +## - # If you don't want to use auto-mounting/unmounting make sure the CD +## - # is mounted on /cdrom +## - # +## - ; preexec = /bin/mount /cdrom +## - ; postexec = /bin/umount /cdrom +## - diff --git a/roles/common/templates/etc/security/limits.conf.j2 b/roles/common/templates/etc/security/limits.conf.j2 new file mode 100644 index 0000000..79cc914 --- /dev/null +++ b/roles/common/templates/etc/security/limits.conf.j2 @@ -0,0 +1,62 @@ +# {{ ansible_managed }} + +# /etc/security/limits.conf +# +#Each line describes a limit for a user in the form: +# +# +# +#Where: +# can be: +# - a user name +# - a group name, with @group syntax +# - the wildcard *, for default entry +# - the wildcard %, can be also used with %group syntax, +# for maxlogin limit +# - NOTE: group and wildcard limits are not applied to root. +# To apply a limit to the root user, must be +# the literal username root. +# +# can have the two values: +# - "soft" for enforcing the soft limits +# - "hard" for enforcing hard limits +# +# can be one of the following: +# - core - limits the core file size (KB) +# - data - max data size (KB) +# - fsize - maximum filesize (KB) +# - memlock - max locked-in-memory address space (KB) +# - nofile - max number of open file descriptors +# - rss - max resident set size (KB) +# - stack - max stack size (KB) +# - cpu - max CPU time (MIN) +# - nproc - max number of processes +# - as - address space limit (KB) +# - maxlogins - max number of logins for this user +# - maxsyslogins - max number of logins on the system +# - priority - the priority to run user process with +# - locks - max number of file locks the user can hold +# - sigpending - max number of pending signals +# - msgqueue - max memory used by POSIX message queues (bytes) +# - nice - max nice priority allowed to raise to values: [-20, 19] +# - rtprio - max realtime priority +# - chroot - change root to directory (Debian-specific) +# +# +# + +#* soft core 0 +#root hard core 100000 +#* hard rss 10000 +#@student hard nproc 20 +#@faculty soft nproc 20 +#@faculty hard nproc 50 +#ftp hard nproc 0 +#ftp - chroot /ftp +#@student - maxlogins 4 + +* - nofile 1048576 +root - nofile 1048576 + + +# End of file diff --git a/roles/common/templates/etc/ssh/sshd_config.j2 b/roles/common/templates/etc/ssh/sshd_config.j2 new file mode 100644 index 0000000..1c80f64 --- /dev/null +++ b/roles/common/templates/etc/ssh/sshd_config.j2 @@ -0,0 +1,349 @@ +# {{ ansible_managed }} + +#----------------------------- +# Daemon +#----------------------------- + +# What ports, IPs and protocols we listen for +{% for item in sshd_ports %} +Port {{ item }} +{% endfor %} + +# Specifies the local addresses sshd(8) should listen on. The following forms may be used: +# +# ListenAddress host|IPv4_addr|IPv6_addr +# ListenAddress host|IPv4_addr:port +# ListenAddress [host|IPv6_addr]:port +# +# If port is not specified, sshd will listen on the address and all Port options specified. The default +# is to listen on all local addresses. Multiple ListenAddress options are permitted. +# +# ListenAddress :: +# ListenAddress 0.0.0.0 +# ListenAddress 159.69.72.24 +# ListenAddress 2a01:4f8:231:171f::2 +# +{% if (sshd_listen_address is defined) and sshd_listen_address %} +{% for item in sshd_listen_address %} +ListenAddress {{ item }} +{% endfor %} +{% endif %} + +# Specifies the protocol versions sshd(8) supports. +# The possible values are ‘1’ , `2' and ‘1,2’. +# The default is ‘2’. +Protocol 2 + +# HostKeys for protocol version 2 +{% for item in sshd_host_keys %} +HostKey {{ item }} +{% endfor %} + +# Lifetime and size of ephemeral version 1 server key +# +# Note: +# Deprecated option KeyRegenerationInterval +# Deprecated option ServerKeyBits +# +#KeyRegenerationInterval 3600 +#ServerKeyBits 768 + +# Specifies the maximum number of concurrent unauthenticated connections +# to the SSH daemon. See sshd_config(5) for specifiing the three colon +# separated values. +# The default is 10. +#MaxStartups 10:30:100 +#MaxStartups 3 +MaxStartups {{ sshd_max_startups }} + +# Specifies the maximum number of authentication attempts permitted per +# connection. +# The default is 6. +MaxAuthTries {{ sshd_max_auth_tries }} + +# Specifies the maximum number of open sessions permitted per network +# connection. +# The default is 10. +MaxSessions {{ sshd_max_sessions }} + + +#----------------------------- +# Authentication +#----------------------------- + +# Specifies whether sshd(8) separates privileges by creating an unprivileged +# child process to deal with incoming network traffic. +# The default is "yes" (for security). +{% if (ansible_facts['distribution'] == "Debian") and (ansible_facts['distribution_major_version']|int > 9) %} +# +# Note: (Release 7.5) +# Deprecated option UsePrivilegeSeparation +# Privilege separation has been on by default for almost 15 years +# sandboxing has been on by default for almost the last five +# +#UsePrivilegeSeparation sandbox +{% else %} +UsePrivilegeSeparation sandbox +{% endif %} + +# The server disconnects after this time if the user has not +# successfully logged in. +# The default is 120 seconds. +LoginGraceTime 120 + +# Specifies whether root can log in using ssh(1). +# The default is "yes". +# Possible values: yes, no, prohibit-password (or teh older one: without-password) +#PermitRootLogin yes +PermitRootLogin {{ sshd_permit_root_login }} + +# Specifies whether sshd(8) should check file modes and ownership of the +# user's files and home directory before accepting login. This is normally +# desirable because novices sometimes accidentally leave their directory or +# files world-writable. Note that this does not apply to ChrootDirectory, +# whose permissions and ownership are checked unconditionally. +# The default is “yes”. +StrictModes yes + +# Specifies whether pure RSA authentication is allowed. This option +# applies to protocol version 1 only. +# The default is “yes”. +# +# Note: +# Deprecated option RSAAuthentication +# +#RSAAuthentication yes + +# Specifies whether public key authentication is allowed. Note that this +# option applies to protocol version 2 only. +# The default is “yes”. +PubkeyAuthentication {{ sshd_pubkey_authentication }} + +# Specifies the file that contains the public keys that can be used for +# user authentication. The format is described in the AUTHORIZED_KEYS FILE +# FORMAT section of sshd(8). +# AuthorizedKeysFile may contain tokens of the form %T which are substituted +# during connection setup. The following tokens are defined: %% is replaced +# by a literal '%', %h is replaced by the home directory of the user being +# authenticated, and %u is replaced by the username of that user. After +# expansion, AuthorizedKeysFile is taken to be an absolute path or one relative +# to the user's home directory. Multiple files may be listed, separated by +# whitespace. +# The default is “.ssh/authorized_keys .ssh/authorized_keys2”. +#AuthorizedKeysFile %h/.ssh/authorized_keys +AuthorizedKeysFile {{ sshd_authorized_keys_file }} + +# Specifies whether password authentication is allowed. +# Change to no to disable tunnelled clear text passwords +# The default is "yes". +#PasswordAuthentication yes +PasswordAuthentication {{ sshd_password_authentication }} + +# When password authentication is allowed, it specifies whether the +# server allows login to accounts with empty password strings. +# The default is “no”. +PermitEmptyPasswords no + +# Specifies whether challenge-response authentication is allowed (e.g. via PAM). +# The default is “yes”. +ChallengeResponseAuthentication no + +# Don't read the user's ~/.rhosts and ~/.shosts files +IgnoreRhosts yes +# For this to work you will also need host keys in /etc/ssh_known_hosts +# +# Note: +# Deprecated option RhostsRSAAuthentication +# +#RhostsRSAAuthentication no + +# similar for protocol version 2 +HostbasedAuthentication no + +# Specifies whether sshd(8) should ignore the user's ~/.ssh/known_hosts +# during RhostsRSAAuthentication or HostbasedAuthentication. +# The default is “no”. +# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication +#IgnoreUserKnownHosts yes + +# If specified, login is allowed only for user names that match one of +# the patterns. +# The allow/deny directives are processed in the following order: DenyUsers, +# AllowUsers, DenyGroups, and finally AllowGroups. +# By default, login is allowed for all users. +{% if (fact_sshd_allowed_users is defined) and fact_sshd_allowed_users %} +AllowUsers {{ fact_sshd_allowed_users }} +{% else %} +#AllowUsers back chris sysadm cityslang christoph +{% endif %} + +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the ChallengeResponseAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via ChallengeResponseAuthentication may bypass +# the setting of "PermitRootLogin without-password". +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and ChallengeResponseAuthentication to 'no'. +UsePAM {{ sshd_use_pam }} + +# Specifies whether login(1) is used for interactive login sessions. +# Note that login(1) is never used for remote command execution. +# Note also, that if this is enabled, X11Forwarding will be disabled +# because login(1) does not know how to handle xauth(1) cookies. If +# UsePrivilegeSeparation is specified, it will be disabled after +# authentication. +# The default is “no”. +#UseLogin no + + +#----------------------------- +# Cryptography +#----------------------------- + +# Specifies the available KEX (Key Exchange) algorithms. +# The default is: +## curve25519-sha256@libssh.org, +## ecdh-sha2-nistp256, +## ecdh-sha2-nistp384, +## ecdh-sha2-nistp521, +## diffie-hellman-group-exchange-sha256, +## diffie-hellman-group14-sha1. +{% if (fact_sshd_kexalgorithms is defined) and fact_sshd_kexalgorithms %} +KexAlgorithms {{ fact_sshd_kexalgorithms }} +{% else %} +#KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256 +{% endif %} + +# Specifies the ciphers allowed for protocol version 2. +# The default is: +## aes128-ctr, +## aes192-ctr, +## aes256-ctr, +## aes128-gcm@openssh.com, +## aes256-gcm@openssh.com, +## chacha20-poly1305@openssh.com. +{% if (fact_sshd_ciphers is defined) and fact_sshd_ciphers %} +Ciphers {{ fact_sshd_ciphers }} +{% else %} +#Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes256-ctr +{% endif %} + +# Specifies the available MAC (message authentication code) algorithms. +# The default is: +## umac-64-etm@openssh.com, +## umac-128-etm@openssh.com, +## hmac-sha2-256-etm@openssh.com, +## hmac-sha2-512-etm@openssh.com, +## umac-64@openssh.com, +## umac-128@openssh.com, +## hmac-sha2-256, +## hmac-sha2-512. +{% if (fact_sshd_macs is defined) and fact_sshd_macs %} +MACs {{ fact_sshd_macs }} +{% else %} +#MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com +{% endif %} + + +#----------------------------- +# Logging +#----------------------------- + +# Gives the facility code that is used when logging messages from sshd(8). +# The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, +# LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. +# The default is AUTH. +SyslogFacility AUTH + +# Gives the verbosity level that is used when logging messages from +# sshd(8). +# The default is INFO. +LogLevel INFO + + +#----------------------------- +# Behavior +#----------------------------- + +# Specifies whether the distribution-specified extra version suffix is included +# during initial protocol handshake. +# The default is "yes". +DebianBanner no + +# The contents of the specified file are sent to the remote user before +# authentication is allowed. +# By default, no banner is displayed. +#Banner /etc/issue.net + +# Specifies whether sshd(8) should print /etc/motd when a user logs in +# interactively. (On some systems it is also printed by the shell, +# /etc/profile, or equivalent.) +# The default is “yes”. +PrintMotd {{ sshd_print_motd }} + +# Specifies what environment variables sent by the client will be copied +# into the session's environ(7). +# The default is not to accept any environment variables. +AcceptEnv LANG LC_* + +# Configures an external subsystem (e.g. file transfer daemon). +# By default no subsystems are defined. +Subsystem sftp /usr/lib/openssh/sftp-server + +# Specifies whether sshd(8) should look up the remote host name and check +# that the resolved host name for the remote IP address maps back to the +# very same IP address. +# The default is “yes”. +UseDNS {{ sshd_use_dns }} + +# Specifies whether X11 forwarding is permitted. The argument must be +# “yes” or “no”. See sshd_config(5) for further expalnation +# The default is “no”. +#X11Forwarding yes + +# Specifies the first display number available for sshd(8)'s X11 +# forwarding. This prevents sshd from interfering with real X11 servers. +# The default is 10. +X11DisplayOffset 10 + +# Specifies whether the system should send TCP keepalive messages to the +# other side. If they are sent, death of the connection or crash of one +# of the machines will be properly noticed. However, this means +# that connections will die if the route is down temporarily, and some +# people find it annoying. On the other hand, if TCP keepalives are not +# sent, sessions may hang indefinitely on the server, leaving “ghost” users +# and consuming server resources. +# +# The default is “yes” (to send TCP keepalive messages), and the server +# will notice if the network goes down or the client host crashes. This +# avoids infinitely hanging sessions. +TCPKeepAlive yes + +#Specifies whether sshd(8) should print the date and time of the last +# user login when a user logs in interactively. +# The default is “yes”. +PrintLastLog yes + + +#----------------------------- +# Kerberos options +#----------------------------- +#KerberosAuthentication no +#KerberosGetAFSToken no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes + + +#----------------------------- +# GSSAPI options +#----------------------------- + +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + + + + +