Samba server user probleem

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

  • pieterrr
  • Registratie: Juni 2009
  • Niet online
Hi,
Ik heb een server staan waarop al mijn data staat en gedownload wordt. Dit wordt dmv een samba server geshared over een windows netwerk. Dit werkt naar behoren.
Stukje smb.conf:

code:
1
2
3
4
5
[Muziek]
      comment = Muziek
      path = /raid/Muziek
      read only = No
      valid users = pieter


Nu wil ik data van een aantal Windows machines backuppen op deze server. Ik wil daar een aparte user voor gebruiken en een folder waar alleen die user toegang tot heeft. Dit krijg ik alleen niet aan de praat.

Ik heb een speciale user aangemaakt, winbackup, en deze ook aan de samba server toegevoegd. Maar winbackup heeft geen toegang tot de share. De share heb ik trouwens om alles te testen even op permissie 777 gezet.

code:
1
2
3
4
5
[Backup]
      comment = Backup
      path = /raid/Backup
      read only = No
      valid users = winbackup


Met bovenstaande code krijgt user winbackup geen toegang tot de share. Als ik user pieter erbij zet, kan die user wel verbinden. Er zit dus een probleem in die 2 users.
Ik heb daarom ook gekeken naar de groepslidmaatschappen van de users. Om alles te testen heb ik winbackup lid gemaakt van dezelfde groepen als pieter, maar ook dit werkt niet.

Ik heb het vermoeden dat ik iets simpels over het hoofd zie, maar wat..?

Acties:
  • 0 Henk 'm!

  • marcop23
  • Registratie: December 2009
  • Laatst online: 10:28
Log jij toevallig op jouw Windows systeem ook in het een user die ''Pieter'' heet?

Acties:
  • 0 Henk 'm!

  • pieterrr
  • Registratie: Juni 2009
  • Niet online
Ja, maar vanaf mijn media center werken de shares ook, en die heet niet zo.

Acties:
  • 0 Henk 'm!

  • BdK9001
  • Registratie: September 2006
  • Nu online

BdK9001

Kalm aan en rap een beetje

Heb je SElinux draaien? Zo ja, dan moet je eerst Samba de juiste premissions geven met SElinux management. Ik had hier een week geleden ook problemen mee. Check voor de zekerheid ook of je linux firewall Samba niet blokkeert

[ Voor 3% gewijzigd door BdK9001 op 22-01-2011 14:24 ]

Kalm aan! En rap een beetje!


Acties:
  • 0 Henk 'm!

  • pieterrr
  • Registratie: Juni 2009
  • Niet online
Samba draait op Ubuntu Server 10.10. SElinux zegt me niets.

Firewall kan het niet zijn toch? Lijkt me dat de Firewall niet 1 bepaalde user blockt toch? Anyway, firewall staat uit.

Edit: Samba draait trouwens als root (logisch ook wel).

[ Voor 13% gewijzigd door pieterrr op 22-01-2011 14:38 ]


Acties:
  • 0 Henk 'm!

  • Lethalis
  • Registratie: April 2002
  • Niet online
smbpasswd -a winbackup

?

Firewall kan het niet zijn (tenzij je alleen bepaalde ip adressen toestaat).. wel is het zo dat Samba misschien alleen toegang verleent voor bepaalde machines. Kijk hiervoor even naar de "interfaces" in je smb.conf.

[ Voor 86% gewijzigd door Lethalis op 22-01-2011 14:58 ]

Ask yourself if you are happy and then you cease to be.


Acties:
  • 0 Henk 'm!

  • pieterrr
  • Registratie: Juni 2009
  • Niet online
Nope, helpt niet.
Ik heb trouwens ook al de unix users gesynchroniseerd met de samba users via webmin. Wat eigenlijk op hetzelfde neer komt.

Acties:
  • 0 Henk 'm!

  • Lethalis
  • Registratie: April 2002
  • Niet online
Hoe test jij precies of de user winbackup toegang heeft?

Log je dan echt in als winbackup op de windows pc en probeer je dan op de samba share te komen? Weet je 100% zeker dat de wachtwoorden overeenkomen?

Kan winbackup wel \\servernaam zien?

[ Voor 23% gewijzigd door Lethalis op 24-01-2011 13:56 ]

Ask yourself if you are happy and then you cease to be.


Acties:
  • 0 Henk 'm!

  • pieterrr
  • Registratie: Juni 2009
  • Niet online
Bij interfaces staat dattie op de localhost staat, dus dat is in orde.

Om te testen of het werkt ga ik naar het ip van de machine, \\192.168.1.101 daar staan alle mappen die geshared zijn. Als ik een map aanklik komt er een inlogscherm. Als ik daar inlog met winbackup krijg ik geen toegang tot de map backup. Op het moment dat ik user pieter bij valid users zet in smb.conf kan ik met user pieter wel inloggen.

Password is sowieso goed. Ik gebruik webmin om het te beheren, en heb gewoon het password gekopieerd en geplakt, dus daar is niks mis mee.

Hieronder mijn volledige smb.conf.
(hoe maak je die trouwens scrollbaar?)

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#
# 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 most of which 
# are not shown in this example
#
# 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. 
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

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

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



#### Debugging/Accounting ####

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

# Cap the size of the individual log files (in KiB).
   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 = user

# 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

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

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

# 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

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
;   winbind enum groups = yes
;   winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) 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 =======================

# 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 director as \\server\username
;[homes]
;   comment = Home Directories
;   browseable = no

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

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

# 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. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# The following parameter makes sure that only "username" can connect
#
# This might need tweaking when using external authentication schemes
;   valid users = %S

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



[Series]
      comment = Series
      path = /raid/Series
      read only = No
      valid users = pieter

[Films]
      comment = Films
      path = /raid/Films
      read only = No
      valid users = pieter

[Downloads]
      comment = Downloads
      path = /raid/Downloads
      read only = No
      valid users = admin pieter


[Watchfolder]
      comment = Watchfolder
      path = /raid/Watchfolder/upload
      read only = No
      valid users = pieter

[Muziekdvd]
      comment = Muziekdvd
      path = /raid/Muziek dvd's
      read only = No
      valid users = pieter

[Muziek]
      comment = Muziek
      path = /raid/Muziek
      read only = No
      valid users = pieter

[Backup]
      comment = Backup
      path = /raid/Backup
      read only = No
      valid users = winbackup

[ Voor 95% gewijzigd door pieterrr op 25-01-2011 20:21 ]


Acties:
  • 0 Henk 'm!

  • Lethalis
  • Registratie: April 2002
  • Niet online
security = user moet aan staan.

Dus je moet dat # teken ervoor weghalen. smb.conf opslaan en even de smbd resetten. (kill -9 doet reload meestal)

Ask yourself if you are happy and then you cease to be.


Acties:
  • 0 Henk 'm!

  • pieterrr
  • Registratie: Juni 2009
  • Niet online
Ook dat werkt niet.

Ik heb inmiddels ook wat logs gevonden, maar daar word ik ook niet wijzer van.
Vanavond probeer ik het wel even vanaf een andere machine.

code:
1
2
3
4
5
6
7
8
9
10
[2011/01/28 10:34:37.346569,  1] smbd/service.c:678(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_ACCESS_DENIED
[2011/01/28 10:34:37.347130,  1] smbd/service.c:678(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_ACCESS_DENIED
[2011/01/28 10:34:37.360045,  1] smbd/service.c:678(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_ACCESS_DENIED
[2011/01/28 10:34:41.456670,  1] smbd/service.c:678(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_ACCESS_DENIED
[2011/01/28 10:34:41.457295,  1] smbd/service.c:678(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_ACCESS_DENIED


Edit: nav de logs heb ik hier iets gevonden wat ik later even ga proberen.

[ Voor 9% gewijzigd door pieterrr op 28-01-2011 10:43 ]


Acties:
  • 0 Henk 'm!

  • tlpeter
  • Registratie: Oktober 2005
  • Laatst online: 11-09 20:22
Ik ben pas bezig met Samba dus misschien heb ik het mis.
Moet je niet alle gebruikers toegang geven tot de share WinBackup?
Er is geen gebruiker met de naam WinBackup (op de pc zelf) dus heb je geen toegang.
Geef ook eens rechten voor de gebruikers van de pc's zelf.

[ Voor 3% gewijzigd door tlpeter op 28-01-2011 10:45 ]


Acties:
  • 0 Henk 'm!

  • pieterrr
  • Registratie: Juni 2009
  • Niet online
Moet je niet alle gebruikers toegang geven tot de share WinBackup?
Dat is juist wat ik niet wil. Bovendien zit daar het probleem ook niet, want user pieter op mn windows machine en pieter op de server hebben verschillende wachtwoorden, en toch werkt het met die user wel.

Acties:
  • 0 Henk 'm!

  • tlpeter
  • Registratie: Oktober 2005
  • Laatst online: 11-09 20:22
Dan weet ik het niet :)
Ik heb er te weinig kaas van gegeten.

Acties:
  • 0 Henk 'm!

  • Lethalis
  • Registratie: April 2002
  • Niet online
Uit het verhaal wat jij hebt gelinked, blijkt dat de credentials op de Windows PC gecached zijn. Hij vraagt je dan dus niet meer om een username en wachtwoord voor die share, maar blijft het elke keer opnieuw proberen met de credentials die je bij de eerste keer hebt ingevuld.

Probeer eens een nieuwe user account aan te maken op de Windows PC met een heel andere naam en wachtwoord, meld je aan met die gebruiker en connect dan eens naar de share. Met een beetje mazzel krijg je een popup waarin je de username en het wachtwoord kunt invullen. Vul dan winbackup en het bijbehorende wachtwoord in.

Werkt dit niet, probeer eens de server op basis van zijn ip adres te benaderen. Dus \\192.168.1.1 (vervang door echte ip adres) in de Windows verkenner intikken bijvoorbeeld.

[ Voor 4% gewijzigd door Lethalis op 29-01-2011 09:53 ]

Ask yourself if you are happy and then you cease to be.


Acties:
  • 0 Henk 'm!

  • pieterrr
  • Registratie: Juni 2009
  • Niet online
Hmm de credentials worden inderdaad opgeslagen.
Als ik mn pc reboot, kan ik via user winbackup bij de backup share, maar niet met user pieter bij de andere shares. Als ik vervolgens weer reboot is het hele verhaal andersom.

Wat ik eigenlijk wil is een aparte user die alleen backups doet, maar zoals ik het nu zie lijkt het niet te kunnen..?

Acties:
  • 0 Henk 'm!

  • Lethalis
  • Registratie: April 2002
  • Niet online
pieterrr schreef op zondag 30 januari 2011 @ 10:23:
Hmm de credentials worden inderdaad opgeslagen.
Als ik mn pc reboot, kan ik via user winbackup bij de backup share, maar niet met user pieter bij de andere shares. Als ik vervolgens weer reboot is het hele verhaal andersom.

Wat ik eigenlijk wil is een aparte user die alleen backups doet, maar zoals ik het nu zie lijkt het niet te kunnen..?
Dat ligt iig niet aan de server.

Je kunt shares ook vanuit de commandline mounten in Windows. Misschien dat dit werkt?

Hiervoor kun je het net use commando gebruiken:

net use \\computer\share password /user:username

Zoiets :)

Bron : http://www.cezeo.com/tips-and-tricks/net-use-command/

Een andere - misschien betere - optie is om jouw backup script / programma onder andere user credentials (winbackup) in Windows te schedulen. Dan kan die er wel bij. Op mijn werk doen we dat ook wel eens. In de task scheduler van Windows kun je namelijk gewoon credentials meegeven aan een scheduled task.

[ Voor 18% gewijzigd door Lethalis op 31-01-2011 08:49 ]

Ask yourself if you are happy and then you cease to be.

Pagina: 1