SAMBA Konfiguration

e.v.o

Light Guard
Servus Mädelz,
ich stehe mal wieder vor der schier unlösbaren Aufgabe meine Ansprüche umzusetzen...
Vielleicht könnt ihr mir mit der config helfen?

> user evo, guest und XXX sind im system und im samba vorhanden
- /mnt/raid soll für jeden im LAN ohne PW/Username NUR lesbar sein (done > map to guest, aber ziemlich stressig mit security = share)
- /mnt/.encfs/ soll nur für den Adminuser (evo) sichtbar und editierbar sein
- /home/guest soll schreibbar sein für jedermann, alle user sollen also automatisch als guest angemeldet werden, auch wenn kein name/pw eingegeben wurde (map to user/guest?)
- user evo darf alles.. eh klar, oder? ;>
- security soll auf user bleiben, da share nicht mehr verwendet werden sollte und als deprecated gekennzeichnet ist...

tja.. es ist nicht leicht mit diesem biest fertig zu werden. bin schier am verzweifeln und es nervt einfach gewaltig für so einen popeligen rotz ewig und drei tage dran zu sitzen. ^^ :hammer:

[EDIT]
Hab mal meine Config für alle interessierten hochgeladen. Die sollte eigentlich alle benötigten Optionen für den Alltagsgebrauch und ein wenig darüber hinaus aufweisen.

Code:
#smb.conf
#
# Samba-3.0.30 - Slackware 12.x
#
#; COMMENT
# #PARAMETER ( name = default value )
# Normally every parameter should have its default value.
# If the parameter is commented out then it is the default value,
# otherwise you should have a look at "man smb.conf"
#
# This config is based on the smb.conf manual page
# and "Using Samba, 3rd Edition" from O'Reilly
#

# VARIABLE SUBSTITUTIONS
; %U	session username
; %G	primary group name of %U
; %h	the Internet hostname that Samba is running on
; %m	the NetBIOS name of the client machine (very useful)
; %L	the NetBIOS name of the server
; %M	the Internet name of the client machine
; %R	the selected protocol level after protocol negotiation
; %d	the process id of the current server process
; %a	the architecture of the remote machine
; %I	the IP address of the client machine
; %i	the local IP address to which a client connected
; %T	the current date and time
; %D	name of the domain or workgroup of the current user
; %w	the winbind separator
; %v	Samba version number
;
; The following substitutes apply only to some configuration options
; Only those that are used when a connection has been established
;
; %S	the name of the current service, if any
; %P	the root directory of the current service, if any
; %u	username of the current service, if any
; %g	primary group name of %u
; %H	the home directory of the user given by %u
; %N	the name of your NIS home directory server
; %p	the path of the service's home directory

[global]
; Parameters in this section apply to the server as a whole

; ### USERSHARES ### # Capability for non-root users to 
; ==================== # add/modify/delete own share definitions 
;
; Controls if usershares can permit guest access
#usershare allow guests   =
; Maximum number of user defined shares allowed
#usershare max shares    =
; If set only directories owned by the sharing user can be shared
#usershare owner only    =
; Directory containing the user defined share definitions
#usershare path       =
; Comma-separated list restricting what directories can be shared
#usershare prefix allow list =
; Comma-separated list restricting what directories can be shared
#usershare prefix deny list =
; Pre-existing share used as a template for creating new usershares
#usershare template share  =

; ### NAME MANGLING ### # By default, Samba has the same
; ======================= # semantics as a Windows NT server
;
; Filenames are case sensitive
#case sensitive   = auto
; Default case for new filenames
#default case    = lower
; New files are created with the case that the client passes
#preserve case    = yes
; New files which conform to 8.3 syntax are created upper case
#short preserve case = yes

; ### PRINTING ###
; ==================
;
; All printers in the printcap will be loaded for browsing by default
load printers      = no
; Only applicable if printing is set to cups.
#cups server      = ""
; Show the "Add Printer Wizard" Dialog
show add printer wizard = no
; Yes = open, write to and submit spool files on the specified directory
printable        = no

; ===============================
; #  -  S E T T I N G S  -  #
; ===============================

; \-= USER SCRIPTS =-/  # These scripts are used on a PDC or stand-alone 
; ====================  # machine to add or delete corresponding unix accounts

; Script that will be run when a new group is requested
#add group script        = /usr/sbin/groupadd %g
; Script that will be run when a machine is added to Samba's domain
#add machine script       = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
; Script which will add a new service definition to smb.conf
#add share command       =
; Script which will add a new user
#add user script        = /usr/sbin/useradd %u
; Script that will be called when a user is added to a group
#add user to group script    =
; Script which will modify an existing service definition in smb.conf
#change share command      =
; Script when a group is requested to be deleted
#delete group script      = 
; Script when a user is removed from a group using the Windows NT domain administration tools
#delete user from group script = /usr/sbin/deluser %u %g
; Script that will be run when managing users with remote RPC (NT) tools
#delete user script       = /usr/local/samba/bin/del_user %u
; Script that will be run under special circumstances
#rename user script       = no
; This script sets the primary group in the unix userdatase when an administrator sets the 
; primary group from the windows user manager or when fetching a SAM with net rpc vampire
#set primary group script    = /usr/sbin/usermod -g '%g' '%u'

; \-= PERMISSION MASKS =-/
; ========================

#directory mask        = 0755
#directory security mask    = 0777
#force create mode       = 000
#force directory mode     = 000
#force directory security mode = 0
#force security mode      = 0
#inherit owner         = no
#inherit permissions      = no
#security mask         = 0777

; \-= USER PARAMETER =-/
; ======================

; List of users who will be granted administrative privileges on the share
admin users   = evo
; This is a list of users that should be allowed to login to this service
valid users   = evo guest
; This is a list of users that should not be allowed to login to this service
invalid users  = root nobody ftp
; This is a list of users that are given read-only access to a service
read list    = evo guest
; This is a list of users that are given read-write access to a service
write list   = evo

; -= Guest Settings =-
; Username which will be used for access to services which are specified as guest ok
guest account  = guest
; Yes for a service, then no password is required to connect to the service
guest ok    = no
; Yes for a service, then only guest connections to the service are permitted
guest only   = no

; -= Forced User/Group Settings =-
; UNIX user name that will be assigned as the default user for all users
;force user = guest
; UNIX group name that will be assigned as the default primary group for all users
force group = users

; -= Map Settings =-
; Specify a file containing a mapping of usernames from the clients to the server
#username map = 
;
#map acl inherit = no
#map archive   = yes
#map hidden    = 
#map read only  = yes
#map system    = no
map to guest   = Bad User

; \-= SHARE PARAMETER =-/
; =======================

; Lets you "turn off" a service. If available = no, then ALL attempts to connect to the service will fail
available    = yes
; Controls whether this share is seen in the list of available shares in a net view and in the browse list
browseable   = yes
; Allow or disallow client access to accounts that have null passwords 
#null password = no
; If this parameter is yes, then users of a service may not create or modify files in the service's directory
read only    = yes
; Setting this parameter to no prevents any file or directory that is a symbolic link from being followed
follow symlinks = no
; This parameter controls whether or not links in the UNIX file system may be followed by the server
wide links   = no

; This parameter specifies the name of a service which will be connected to if the service actually requested cannot be found
#default service = 
; This parameter allows you to specify a comma-delimited list of directories that the server should always show as empty
dont descend   = /proc,/dev,/etc,/var,/boot,/bin,/lib,/usr,/sys,/srv,/sbin

; -= Hide Files =-
; This is a boolean parameter that controls whether files starting with a dot appear as hidden files
#hide dot files     = yes
; This is a list of files or directories that are not visible but are accessible
#hide files       = 
; This parameter prevents clients from seeing special files such as sockets, devices and fifo's in directory listings
#hide special files   = no
; This parameter prevents clients from seeing the existance of files that cannot be read
#hide unreadable    = no
; This parameter prevents clients from seeing the existance of files that cannot be written to
#hide unwriteable files = no

; \-= WINDOWS PARAMETER =-/
; =========================

; Specifies the charset that samba will use to print messages to stdout and stderr
#display charset = "LOCALE" or "ASCII" (depending on the system)
; This option specifies which charset Samba should talk to DOS clients
#dos charset = # No default
; Enabling this parameter allows a user who has write access to the file (by whatever means) to modify the permissions
#dos filemode = no

; \-= NETWORK/CONNECTION PARAMETER =-/
; ====================================

; This controls what workgroup your server will appear to be in when queried by clients
workgroup = KlingKlang
; This controls what string will show up in the printer comment box in print manager and next to the IPC connection in net view
server string = FileDealer
; This sets the NetBIOS name by which a Samba server is known
netbios name = FileDealer
#netbios aliases = 

; -= Interface Settings =-
; This parameter is a comma, space, or tab delimited set of hosts which are permitted to access a service
hosts allow = 127.0.0.1 192.168.
hosts deny = ALL

; -= Connection Options =-
; Represents the number of minutes of inactivity before a connection is considered dead and disconnected
#deadtime    = 0 
; The value of the parameter (an integer) represents the number of seconds between keepalive packets
#keepalive    = 300
; This option allows the number of simultaneous connections to a service
#max connections = 0
; This option allows you to set socket options to be used when talking with the client
socket options  = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536

; \-= OTHER PARAMETER =-/
; =======================

security = user

; Enabling this parameter will disable netbios support in Samba
#disable netbios = no

; -= SMBpasswd Settings =-
; This option allows the administrator to chose which backend will be used for storing user and possibly group information
#passdb backend = smbpasswd:/etc/samba/private/smbpasswd
; This option sets the path to the encrypted smbpasswd file
#smb passwd file = ${prefix}/private/smbpasswd

; -= Directory Settings =-
; This option specifies the directory where lock files will be placed
#lock directory = ${prefix}/var/locks
; This parameters defines the directory smbd will use for storing such files as smbpasswd and secrets.tdb
#private dir = ${prefix}/private

; -= Log File Settings =-
; This option allows you to override the name of the Samba log file
log file = /var/log/samba/samba.%m
; This option (an integer in kilobytes) specifies the max size the log file should grow to
max log size = 5000

; 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.
; Note: Consider carefully the location in the configuration file of
;    this line. The included file is read at that point.
#include = /etc/samba/smb.conf.%m

; ===========================
; #  -  S H A R E S  -  #
; ===========================

[homes]
comment  = Eigene Dateien

guest ok  = yes
read only = no
browseable = no

[printers]
comment  = Drucker
path    = /var/spool/samba

browseable = no
available = no
guest ok  = no
printable = yes

[BitHalde]
comment  = 3TB
path   = /mnt/raid

guest ok = yes
read only = yes

Wenn ihr euch nur die von euch verwendeten Parameter anzeigen lassen wollt:
testparm eingeben und ihr solltet folgende Ausgabe, ohne Fehler, bekommen:
Code:
[global]
	workgroup = KLINGKLANG
	server string = FileDealer
	map to guest = Bad User
	guest account = guest
	log file = /var/log/samba/samba.%m
	socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
	load printers = No
	show add printer wizard = No
	invalid users = root, nobody, ftp
	valid users = evo, guest
	admin users = evo
	read list = evo, guest
	write list = evo
	force group = users
	hosts allow = 127.0.0.1, 192.168.
	hosts deny = ALL
	wide links = No
	follow symlinks = No
	dont descend = /proc,/dev,/etc,/var,/boot,/bin,/lib,/usr,/sys,/srv,/sbin

[homes]
	comment = Eigene Dateien
	read only = No
	guest ok = Yes
	browseable = No

[printers]
	comment = Drucker
	path = /var/spool/samba
	printable = Yes
	browseable = No
	available = No

[BitHalde]
	comment = 3TB
	path = /mnt/raid
	guest ok = Yes
 

e.v.o

Light Guard
Tjaja.. aber so einfach gebe ich mich nicht geschlagen.

Es war natürlich ein Problem mit FuSE.
Lustigerweise habe ich weder FuSE noch sonst irgendwas geupdated. Hat wie immer von einen auf den anderen Tag nicht funktioniert.

An die Linux-User hier: :fuck:
Ihr habt ernsthaft einen an der Klatsche ^^
 

Burzum

Fiend
Lügenbold! ;) Linux ist perfekt und funktioniert immer und ist sowieso vieeeel Besser als Windows!

Hab ich etwas von dem Bullshitgelaber der Linuxsektierer vergessen?
 

Scarrus

Arch-Vile
Originally posted by e.v.o@Sonntag, 06.Juli 2008, 13:48 Uhr
Tjaja.. aber so einfach gebe ich mich nicht geschlagen.

Es war natürlich ein Problem mit FuSE.
Lustigerweise habe ich weder FuSE noch sonst irgendwas geupdated. Hat wie immer von einen auf den anderen Tag nicht funktioniert.

An die Linux-User hier: :fuck:
Ihr habt ernsthaft einen an der Klatsche ^^
FuSe?

Macht irgendwie Sinn... :fuck:
 

e.v.o

Light Guard
Scheinbar reicht FuSE das ganze ebend doch nicht so transparent auf Dateisystemebene durch wie es eigentlich sein sollte.

Ich kann bei Gelegenheit mal meine ganzen configs posten. Bin ja sehr auf penibelgenaue Konfigs bedacht und lasse mir da schon mal etwas mehr Zeit (wie man an der Samba konfig sieht).

Ich denke mal das meine privaten Ansprüche den meisten genügen dürften
 

e.v.o

Light Guard
Originally posted by tux-fan@Donnerstag, 31.Juli 2008, 08:20 Uhr
Installier SWAT und konfigurier damit.
Ahahahahahaha.. ich hab sooo lange drauf gewartet das diese Antwort kommt.

Wie ich das Frickelpack hasse. Mal ernsthaft, hat sich irgendeiner von euch jemals tiefer mit auch nur einer einzigen Software vom Compilen bis zum Konfigurieren und Scripten auseinander gesetzt? Alle selbsternannten Linuxfreunde die ich bisher kennen lernen dürfte arbeiteten nach der "Quick & Dirty" Methode: Hauptsache es läuft, egal wie.

Dein Vorschlag ist wirklich nett gemeint, ich habe mir sogar Webmin installiert um Samba zu konfigurieren. Aber wenn du Samba über security = user mit meinen einfachen ansprüchen (und hey, ich will einfach nur das samba ganz genauso reagiert wie unter windows.. und zwar GANZ genauso) einigermaßen brauchbar, sicher und das wichtigste: RICHTIG konfigurieren willst, dann musste einfach selber handanlegen und vieeeeeel lesen und testen ;)

Mag sicherlich auch an Windows selber liegen, das teilweise wirklich strange reagiert, aber SAMBA richtig zu konfigurieren erfordert ernsthaftlich viel Schweiss. So ist es mir z.B. immernoch nicht möglich als user "evo" mein zeug zu verwalten, trotz eingerichtetem user
 

Scarrus

Arch-Vile
Kannst ja mal eine andere Distro probieren die nicht so"Grafisch" orientiert ist...
FuSe(Fuck you - Special Edition) ist ja bekanntlich so ein irgendwie zusammen gebastletes Crap. Vielleicht liegt es ja gar nicht mal an Samba sondern an der Art wie FuSe die ganze Netzwerk-protokollierung und Verwaltung eben verwaltet. Und bei sowas kann man sich bei FuSe(again Fuck you - Special Edition) den ganzen Kopf verdrehen und es will dann trotzdem nicht laufen...
 

tpax

Arch-Vile
Originally posted by Scarrus@Freitag, 01.August 2008, 00:26 Uhr
Kannst ja mal eine andere Distro probieren die nicht so"Grafisch" orientiert ist...
FuSe(Fuck you - Special Edition) ist ja bekanntlich so ein irgendwie zusammen gebastletes Crap. Vielleicht liegt es ja gar nicht mal an Samba sondern an der Art wie FuSe die ganze Netzwerk-protokollierung und Verwaltung eben verwaltet. Und bei sowas kann man sich bei FuSe(again Fuck you - Special Edition) den ganzen Kopf verdrehen und es will dann trotzdem nicht laufen...
Redet ihr da vom gleichen FUSE? Vom Kernel-Modul, oder gibt es auch eine Distro die FUSE heißt? Ich könnte mir vorstellen, dass Samba mit non-root eingebundenen Dateisystemen nicht richtig funktioniert.
 

Burzum

Fiend
Originally posted by [Crusader]@Sonntag, 06.Juli 2008, 13:46 Uhr
Warst du nicht vor kurzem noch selbst son Linux-Fanatiker?
Ich halte Linux nach wie vor für die technisch bessere Wahl als das bisherige Windows.

Das Traurige ist aber, das die guten technischen Ansätze von Ideologie und Uneinigkeit zunichte gemacht werden und sich in erbärmliche Nachteile umkehren.

Linux ist für mich persönlich gestorben nachdem ich wirklich JEDES Problem oder Aufgabe mit Windows schneller lösen konnte.

Z.B. php5.2.5 unter Ubuntu 6.06 Server: Ich wählte 6.06 LTS (LONG TERM SUPPORT!) genau wegen LTS aus. So, jetzt war aber kein verdammtes Package mit einer halbwegs aktuellen Version zu kriegen (ich brauch 5.2.5!), die letzte ist 5.1.x. Google half nicht viel, der Versuch php 5.2.5 selbst zu kompilieren endete mit einem ewigen Zusammensuchen der nötigen Sourcen für Libs und Mods und natürlich funktionierte die ganze SCHEISSE dann auch nicht. In 3h installier ich ein komplettes Windows als Dev-Umgebung inklusive Webserver mit php 5.2.5... Ok, weiter im Text: Bei Nachfrage bei den ach so schlauen Fricklern bekam ich dann die absolut geniale Antwort es gäbe kein 5.2.5 Package weil sich LTS nur auf SICHERHEITSKRITISCHE Updates beziehen würde.

Ok. Alles klar. php 5.2.5 (man lese das Changelog) kein sicherheitskritisches Update??? Auf einem Webserver??? php werkelt quasi an der Front mit. Hat der an Stallmanns Achsel geschnuppert? Ich HASSE diese scheiß Linuxsektierer inzwischen!

Und das war nur eins der vielen lustigen Probleme die ich mit Linux hatte. Sicher IRGENDWIE lief der Scheiß immer aber der dafür nötige Zeitaufwand ist absolut inakzeptabel und die Lösung meist nur eine Frickellösung damit es "irgendwie" geht.

Die ganzen scheiß Unterschiede in den Konfigurationen, in einer Manfile (!), in Sachen Verzeichnisstruktur, Scripten usw... boar es ist zum KOTZEN. Wenn es ein komplexeres Problem ist bei dem 2-x Programme zusammenarbeiten dann erstmal viel Spaß und Glück das Du eine Anleitung oder Tutorial findest die für: Diese Distri UND die beiden Versionen der Programme findest. Stimmt eins davon nicht, stimmen spätestens auf der zweiten Seite irgendwelche Pfade oder Parameter nicht mehr. Mir reichs.
 

CruSAdeR

Maledict
Ja genau so einen Eindruck hat mir Linux von Anfang an gemacht. Hab zwar nie kompliziertere Sachen versucht, aber auch die eigentlich einfachsten Sachen waren schon endlos kompliziert. Um bei meiner Maus die zusätzlichen Tasten hinzubekommen, musste man in irgendeiner Configdatei irgendnen kryptischen Mist hinschreiben. Wie es auf dieser Hilfeseite erklärt war, hat es aber auch natürlich nicht geklappt ^^
 

e.v.o

Light Guard
Lieber Kinder,
mir ging es in meinen letzten Beiträgen um das allgemeine Einrichten und Konfigurieren von Samba.

Das anfängliche Problem, des nicht erkennens der Ordner, war natürlich ein FuSE Problem. Warum aber trotz "chmod 777" die Verzeichnisse nicht zu sehen waren bleibt mir ein Rätsel.
Mein momentaner mount Befehl musste also um diese kleine Option ergänzt werden:
encfs /mnt/.encfs/raid1/.encfs /mnt/raid/raid1
encfs --public /mnt/.encfs/raid1/.encfs /mnt/raid/raid1
Hier mal das Zitat aus der encFS bzw. FuSE man-page:
-- The -- option tells encfs to send any remaining arguments directly
to FUSE.

--public
Attempt to make encfs behave as a typical multi-user filesystem.
By default, all FUSE based filesystems are visible only to the user
who mounted them. No other users (including root) can view the
filesystem contents. The --public option does two things. It adds
the FUSE flags "allow_other" and "default_permission" when mounting
the filesystem, which tells FUSE to allow other users to access the
filesystem, and to use the ownership permissions provided by the
filesystem. Secondly, the --public flag changes how encfs's node
creation functions work - as they will try and set ownership of new
nodes based on the caller identification.

Warning: In order for this to work, encfs must be run as root --
otherwise it will not have the ability to change ownership of
files. I recommend that you instead investigate if the fuse
allow_other option can be used to do what you want before consider-
ing the use of --public.

Wie zu erkennen tun sich hier natürlich etliche weitere Probleme auf. Bestes Beispiel dürfte wohl die Tatsache sein das encFS als root laufen muss. Wirklich Klasse! Damit unterminiert man natürlich jegliches Sicherheitskonzept.
Was mich persönlich am meisten wundert ist die Tatsache das ich dies bisher NIE angeben musste in den vergangenen Jahren. Das einzigste das sich geändert hatte, auch auf diesem System war der Kernel. Do i have to say more? ^^

Zu Samba:
Samba an sich ist ein echt geiles Tool. Bloss leider ist die Konfiguration crap hoch zehn. Warum?
> Komplett uneinheitlich und nicht zusammengefasste Konfigurationsoptionen von denen es ein paar hundert Stück gibt!
> Absolute unübersichtlichkeit der man-page und dazugehörige Beispiele sind ungenügend, da sie immer nur lächerliche Szenarios abdecken. Selbst die Beispiele (im Source unter Examples zu finden) sind an Lächerlichkeit nicht mehr zu überbieten. Weder kann man damit mal einfach ebend schnell Samba für ein 500 Mann LAN aufsetzen, noch für die User oder geschweige den Druckserver RICHTIG einrichten.
> Samba so einzurichten das es funzt ist eine Arbeit von 1 Minute. Samba richtig einzurichten ist unmöglich. SWAT und WebMin sind lächerliche Versuche dieses Monster zu bändigen
> Lustigerweise und am amüsantesten ist die Tatsache das z.B. selbst die man-page der alten Version nur so vor Fehlern gestrotzt hat und die Entwickler teilweise selber nicht mehr durchblicken beim Funktionsumfang!
> Die Inkonsistenz in der Schreibweise, Pfadangaben und sogar beim compilen sind grauenhaft.

Burzum bringt es mit diesen drei Sätzen perfekt auf den Punkt:
Ich halte Linux nach wie vor für die technisch bessere Wahl als das bisherige Windows.

Das Traurige ist aber, das die guten technischen Ansätze von Ideologie und Uneinigkeit zunichte gemacht werden und sich in erbärmliche Nachteile umkehren.

Linux ist für mich persönlich gestorben nachdem ich wirklich JEDES Problem oder Aufgabe mit Windows schneller lösen konnte.
 
Top