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!