Dies ist eine alte Version des Dokuments!


Samba einrichten

Auf meinem NAS habe ich eine Samba-Freigabe eingerichtet, damit ich auf die angeschlossenen Festplatten auch unter Windows zugreifen kann.

Zuerst muss Samba installiert werden:

apt-get install samba samba-common

Jeder Nutzer auf dem Linux-System kann ein Samba-Nutzer sein. Dazu muss er sich mit smbpasswd ein Samba-Passwort geben.

Hier eine Sample-Konfiguration (/etc/samba/smb.conf) ohne Drucker, mit Guest-Share und einem User-Share.

smb.conf
[global]
    workgroup = WORKGROUP        # Name of workgroup the server will appear in
    server string = %h, Samba %v # String presented to the client
    security = user              # Authentication passed on username/password
    invalid users = root         # Root is not allowed as user
    load printers = no           # Does not load printers from printcap
 
    map to guest = bad user      # Unknown user are mapped to guest account
    guest account = nobody       # User for guest account
 
    # Options to improve read/write performance
    socket options = IPTOS_LOWDELAY TCP_NODELAY
    use sendfile = yes
    write cache size = 262144
    min receivefile size = 16384
    strict allocate = yes
 
[Guest Share ]
    path = /path/to/guest/share
    guest ok = yes
    read only = yes              # Set to 'no' to grant write access to share
    veto files = /*lost+found*/  # Hide certain files and directories
 
[User Share]
    valid users = user           # User(s) allowed to access this share
    path = /path/to/user/share
    read only = no               # User has write access to share
    create mask = 0600           # Rights for newly created files
    directory mask = 0700        # Rights for newly created directories
    veto files = /*lost+found*/  # Hide certain files and directories
  • Zuletzt geändert: 2018-09-08 14:24