kein Zugriff von Windows auf Samba freigaben

andylinux

andylinux

Routinier
Hi Leute,

das Problem liegt darin, dass nicht auf meinen Drucker und meine Ordner zugegriffen werden kann. Ich habe schon recherchiert und die Datei entsprechend geändert. Ich frage mich was das noch falsch ist.

Hier mal meine smb.conf

Code:
#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = LAN

# server string is the equivalent of the NT Description field
   server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
;   wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
;   name resolve order = lmhosts host wins bcast

#### Networking ####

# 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

# 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.
;   bind interfaces only = true



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
   max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
;   syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
   syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
   security = share

# You may wish to use password encryption.  See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
   encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.  
   passdb backend = tdbsam

   obey pam restrictions = yes

   guest account = nobody
   invalid users = root

# 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 = no

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\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 = no

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
;   domain logons = yes
#
# The following setting only takes effect if '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
;   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

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
;   printing = bsd
;   printcap name = /etc/printcap

# CUPS printing.  See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
   printing = cups
   printcap name = cups

# When using [print$], root is implicitly a 'printer admin', but you can
# also give this right to other users to add drivers and set printer
# properties
   printer admin = @lpadmin


############ 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

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
#         SO_RCVBUF=8192 SO_SNDBUF=8192
   socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
;   message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
;   domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares.  This will share each
# user's home directory as \\server\username
[homes]
   comment = Home Directories
   browseable = no

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.  Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
   valid users = %S

# By default, the home directories are exported read-only. Change next
# parameter to 'yes' if you want to be able to write to them.
   writable = no

# File creation mask is set to 0600 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0664.
   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

# 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
;   writable = no
;   share modes = no

# 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

wins support = no
[printers]
   comment = All Printers
   browseable = yes
   path = /var/spool/samba
   printable = yes
   public = yes
   writable = yes
   create mode = 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 = no
   guest ok = yes
# Uncomment to allow remote administration of Windows print drivers.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
   write list = root, @LAN

# A sample share for sharing your CD-ROM with others.
;[cdrom]
;   comment = Samba server's CD-ROM
;   writable = no
;   locking = no
;   path = /cdrom
;   public = 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


[Shared]
path = /home/andy/Shared
available = yes
browsable = yes
public = yes
writable = yes
comment = Frei liesbar

[Shared2]
path = /home/andy/Shared2
comment = saugen
available = yes
browsable = yes
public = yes
writable = yes
 
Mit was versuchst du auf die Freigaben zuzugreifen?
Mit Vista gabs glaub ich mal Probleme. Weil die Leute vom MS die Protokolle geändert haben....
 
die user hast aber schon mit smbpassword - a und -e angelegt und aktiviert ? vista macht null probs wenn man die business oder ultimate nimmt
 
Mit na home-premium und na Samba Version von
Code:
kompaktes:/home/sim4000 # smbd --version
Version 3.0.23d-6-1083-SUSE-SL10.2
Kam ich nich auf meine Linux-Kiste drauf...
 
ne die user hab ich nicht angelegt, ich dachte (winXP) die user können ohne anmeldung zugreifen
 
ne du musst um es richtig zu machen die user unter linux anlegen mit password und dann eir oben beschrieben anlegen.

Code:
# Samba config file created using SWAT
# from 192.168.2.161 (192.168.2.161)
# Date: 2007/06/04 18:38:01

[global]
        workgroup = dein domainname
        server string = so steht es dann unter windows
        update encrypted = Yes
        map to guest = Bad User
        passwd program = /usr/bin/passwd %u
        passwd chat = *password* %n\n *password* %n\n *sussessfull*
        password level = 4
        unix password sync = Yes
        name resolve order = lshosts
        time server = Yes
        keepalive = 600
        printcap name = cups
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
        logon script = %U.bat
        logon path = \\%L\profiles\%U
        logon home = \\%L\profiles\%U
        domain logons = Yes
        os level = 255
        preferred master = Yes
        domain master = Yes
        wins proxy = Yes
        wins support = Yes
        ldap ssl = no
        hosts allow = 192.168.2.0/24
        cups options = raw
        dos filetime resolution = Yes

[netlogon]
        comment = Network Logon Service
        path = /home/netlogon
        write list = ntadmin

[profiles]
        comment = User Profiles
        path = /var/lib/samba/profiles/
        read only = No
        root preexec = PROFILE=/var/lib/samba/profiles/%U; if [ ! -e $PROFILE ]; then mkdir -pm700 $PROFILE; chown %U:%G $PROFILE; fi

[users]
        comment = All users
        path = /home
        read only = No
        inherit acls = Yes
        veto files = /aquota.user/groups/shares/

[groups]
        comment = All groups
        path = /home/groups
        read only = No
        inherit acls = Yes

[printers]
        comment = All Printers
        path = /var/tmp
        create mask = 0600
        printable = Yes
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin, root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775


[beispiel user home freigabe]
        comment = username
        path = /home/user/username
        invalid users = wer darf nicht
        valid users = deine user
        admin users = deine user
        read list = deine user
        write list = deine user


[beispiel ordnerfreigabe]
        path = /home/user/internet
        valid users = deine user
        admin users = deine user
        read list = deine user
        write list = deine user

[ml1520]
        comment = Samsung ML-1520
        path = /var/tmp
        read only = No
        create mask = 0600
        guest ok = Yes
        printable = Yes
        printer name = ml1520
        oplocks = No
        share modes = No

[homes]
        valid users = %S
        read only = No
        browseable = No

[officejet5600series]
        comment = HP Officejet 5600 series
        path = /var/tmp
        read only = No
        create mask = 0600
        guest ok = Yes
        printable = Yes
        printer name = officejet5600series
        oplocks = No
        share modes = No

mit dieser smb.conf werden die pc automatisch beim einbinden in die domain angelegt. auch ein profilspeicher ordner wird für jeden user automatisch geladen also eigene dateien.

viel spass
 
Zuletzt bearbeitet von einem Moderator:
Und wenn das ganze ohne Userlogin gehen soll musst du noch in den [global]-Teil
Code:
security = share
einbauen. User musst du aber trotzdem anlegen.

//edit
Man mach ich hier im moment mist... :D
Man ich weiss es nicht... Mal stehts so im Netz, aml anders. Im meiner *.conf ists im [global]-Teil
Hier:
Code:
[global]
        workgroup = BLECHNET
        printcap name = cups
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = No
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
        domain master = No
        restrict anonymous = no
        server string = Freigaben von Kompaktes
        max protocol = NT
        acl compatibility = winnt
        ldap ssl = No
        server signing = Auto
        domain logons = No
        security = user

[profiles]
        comment = Network Profiles Service
        path = %H
        read only = No
        store dos attributes = Yes
        create mask = 0600
        directory mask = 0700

[users]
        comment = All users
        path = /home
        read only = No
        inherit acls = Yes
        veto files = /aquota.user/groups/shares/

[groups]
        comment = All groups
        path = /home/groups
        read only = No
        inherit acls = Yes

[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775

[www]
        comment = htdocs from kompaktes
        path = /srv/www/htdocs
        read only = No
        inherit acls = Yes
        veto files = /aquota.user/groups/shares/
 
Zuletzt bearbeitet:
Hallo!

Um nicht einen neuen Thread zu erstellen schreib ich einfach hier weiter:

Ich habe meinen Linux Client (Debian 4.0 Etch) in eine Windows Domäne eingehängt. Der Login funktioniert nun auch über die Domainaccounts, da ich die per Winbind überprüfe. Meine smb.conf sieht folgendermaßen aus:

Code:
#
# /etc/samba/smb.conf - config file for Samba
#
[global]
	workgroup = X
	netbios name = BA-SERVER-003-1
	netbios aliases = BA-SERVER-003-1
	realm = X.X.DE
	security = DOMAIN
	password server = X
	server string = BA-SERVER-003-1
	wins support = yes
	dns proxy = no
	log file = /tmp/samba_log.%m
	max log size = 1000
	syslog = 0
	panic action = /usr/share/samba/panic-action %d
	idmap uid = 15000-20000
	idmap gid = 15000-20000
	template shell = /bin/bash
	template homedir = /home-ads/%D/%U
	winbind separator = /
	winbind use default domain = yes
	winbind enum users = yes
	winbind enum groups = yes
	winbind cache time = 15
	winbind uid = 15000-20000
	winbind gid = 15000-20000
	use sendfile = yes
	obey pam restrictions = yes
	interfaces = 192.168.100.41/255.255.255.0
	bind interfaces only = yes
	invalid users = root
	passwd program = /usr/bin/passwd %u
	passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
	socket options = TCP_NODELAY 

[printers]
	comment = All Printers
	browseable = no
	path = /var/spool/samba
	printable = yes
	public = no
	writable = no
	create mode = 0700 

[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers
	browseable = yes
	read only = yes
	guest ok = no 

[homes]
	path = /home-ads/%D/%U
	comment = Home Directories
	browseable = no
	read only = No
	create mask = 0755
	directory mask = 0775
	valid users = %D/%S
	writeable = yes 

[data]
	comment = Tomcat Verzeichnisse
	valid users = brand
	writeable = yes
	path = /data
	browseable = no 

[pdf]
	valid users = pdf
	writeable = yes
	path = /home/pdf
	browseable = no

Wenn ich mich direkt auf dem Rechner mit meinem Domänenuser einlogge funktioniert alles prima - auch über Windows. Mein Homeverzeichnis wird angelegt falls ich noch keines habe und ich kann darauf zugreifen.

Die expliziten Freigaben [data] und [pdf] funktionieren leider nicht! Und das ist mein Problem.

Wenn ich unter Windows die Freigabe direkt als Laufwerk mappen möchte frägt er zwar nach Benutzer und Passwortkennung, doch der lokal angelegte Benutzer 'brand' und, wenn ich valid users = meinen domänenbenutzer einstelle, wird nicht angenommen.

Das Userpasswort per smbpasswd zu setzen is auch recht unnütz und funktioniert glaub ich garnicht, da die User ja von dem Domänencontroller gelesen werden.

Wäre dankbar für jede Hilfe :)

Grüße,
quaddy
.
.
.
EDIT (autom. Beitragszusammenführung) :
.

Hi,

mein Problem hat sich so eben gelöst :)

Für alle die das selbe Problem haben:
In Windows muss bei der Benutzeranmeldung SERVERNAME\User stehen dass Samba bzw Winbind weiß es ist ein lokaler User :)

Grüße
 
Zuletzt bearbeitet von einem Moderator:

Ähnliche Themen

Zugriff Ubuntu 16.04. auf Freigabe 18.04. LTS nicht möglich

Nginx als Reverse Proxy für Nextcloud und Emby

Samba 4.9.5-Debian - Kennwort von unix übernehmen

Samba-Server mit Univention Corporate Server

Samba Dateien und Ordner verschieben

Zurück
Oben