LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-03-2011, 02:22 PM   #1
Gargravarr2112
LQ Newbie
 
Registered: Jul 2011
Distribution: Debian
Posts: 13

Rep: Reputation: Disabled
Question Samba with Mac Client - Files created as root?!


Hi all,

This is a weird one. I've got Samba setup on my server, with three main shares - Storage, Media and Home. When I connect to any of the shares from my MacBook Pro (running Snow Leopard), if I write a file to any of my folders, the file is created as root!

I'm logged in as me with my own personal login details. Yes, root is allowed to login to Samba since my server is also a domain controller. I haven't forced any changes to the username through the Samba conf, though the group does get modified for the non-Home shares.

It not only does this from my Mac, but I've just checked, and a file I put there using an XP workstation (one of my domain computers) also created the file as root, so this is definitely a server-side issue.

The only thing I can think of, is that I configured Samba to allow my user to be a Domain Admin indirectly, by pointing the Group Mappings at a group containing myself and root. No other users seem to have this problem.

Enclosed is my smb.conf:
Code:
# Samba config file created using SWAT
# from UNKNOWN (192.168.1.128)
# Date: 2011/09/16 21:59:28

[global]
	workgroup = 69TD.NET
	server string = Excalibur
	map to guest = Bad User
	obey pam restrictions = Yes
	passwd program = /usr/bin/passwd %u
	passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
	username map = /etc/samba/smbusers
	unix password sync = Yes
	unix extensions = off
	syslog = 0
	log file = /var/log/samba/log.%m
	max log size = 1000
	time server = Yes
	printcap name = cups
	add user script = /usr/sbin/useradd -m %u
	delete user script = /usr/sbin/userdel -r %u
	add group script = /usr/sbin/groupadd %g
	delete group script = /usr/sbin/groupdel %g
	add user to group script = /usr/sbin/groupmod -A %u %g
	delete user from group script = /usr/sbin/groupmod -R %u %g
	add machine script = sudo /usr/sbin/useradd -s /bin/false -d /var/lib/nobody '%u' -g machine
	logon script = 
	logon path = \\%L\profiles\%U
	logon drive = N:
	logon home = \\%L\%U
	domain logons = Yes
	os level = 35
	preferred master = Yes
	domain master = Yes
	dns proxy = No
	panic action = /usr/share/samba/panic-action %d
	idmap uid = 15000-20000
	idmap gid = 15000-20000
	admin users = @admin

[homes]
	comment = Home Directories
	valid users = %S
	read only = No
	create mask = 0755
	browseable = No

[web]
	comment = Excalibur Web Directory
	path = /var/www/
	valid users = gargravarr
	force user = www-data
	force group = web
	read only = No
	create mask = 0770
	directory mask = 0770
	browseable = No

[media]
	comment = 1TB Media RAID
	path = /raid/media
	force group = users
	read only = No
	create mask = 0775
	directory mask = 01775
	guest ok = Yes

[storage]
	comment = File Storage
	path = /home/storage
	force group = users
	read only = No
	create mask = 0775
	directory mask = 01775
	guest ok = Yes

[backup]
	comment = WD Elements 320GB Backup USB Drive
	path = /backup
	valid users = gargravarr
	read only = No
	create mask = 0770
	directory mask = 0770
	browseable = No

[netlogon]
	comment = Network Logon Service
	path = /var/lib/samba/netlogon
	guest ok = Yes
	browseable = No
	share modes = No

[profiles]
	comment = Users profiles
	path = /var/lib/samba/profiles
	read only = No
	profile acls = Yes
	browseable = No

[printers]
	comment = All Printers
	path = /var/spool/samba
	create mask = 0700
	printable = Yes
	browseable = No

[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers
This has got me really puzzled. Can anyone suggest a possible reason why this might be happening? I'm finding myself typing 'sudo chown -R <me>' far too much! Thanks in advance!
 
Old 11-03-2011, 02:31 PM   #2
Gargravarr2112
LQ Newbie
 
Registered: Jul 2011
Distribution: Debian
Posts: 13

Original Poster
Rep: Reputation: Disabled
...I might actually have solved it, I just removed my user from the group mapped to Domain Admins, logged out and back into Samba and the file I created, was created user my username. I'll experiment a little more, but this looks promising. Sorry to bother people!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Samba Share and Mac OS X - Files Disappearing? klugenratte Linux - Software 15 12-25-2011 11:58 PM
cant able to edit files which are created in samba shared folder raghoos666 Linux - Server 12 10-13-2010 08:04 AM
samba - windows files lose "created on" date stamp when moved to samba share on linux jaredk51 Linux - Software 5 02-19-2010 03:13 PM
Files created with root ownership on SAMBA Windows shares sixerjman Linux - Software 5 03-08-2007 08:39 AM
samba: mount-folder in client gives only root permissions mvo Linux - Newbie 3 09-16-2005 11:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration