I have a CIFS client w/a regular user. I have a SAMBA server where the only user is root. I want the user on the client system to be able to access the files on the remote server as root. So far I can't, even though I've used options like "uid", "setuid", etc. The client just sees the remote files as belonging to "root" and "permission denied" is all I get.
The server, which runs OpenELEC, shared with guest permissions, so the solution is unlikely to involve profound changes to the server. The client is running Ubuntu 14.04.02.
This is the samba.conf file, which I think overrides the smb.conf. I took it from a template and added only the last share:
###############################################################################
# This file is part of OpenELEC - ...
# Copyright (C) 2009-2014 Stephan Raue ([email protected])
#
# OpenELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <.../licenses/>.
################################################################################
# samba.conf
# This configuration file allows you to customize the samba shares
# available from your machine
[global]
server string = OpenELEC
workgroup = WORKGROUP
netbios name = %h
security = share
guest account = root
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
smb ports = 445
max protocol = SMB2
min receivefile size = 16384
deadtime = 30
os level = 20
mangled names = no
syslog only = yes
syslog = 2
name resolve order = lmhosts wins bcast host
preferred master = auto
domain master = auto
local master = yes
printcap name = /dev/null
load printers = no
browseable = yes
writeable = yes
printable = no
encrypt passwords = true
enable core files = no
passdb backend = smbpasswd
smb encrypt = disabled
use sendfile = yes
# Using the following configurations as a template allows you to add
# writable shares of disks and paths under /storage
[Update]
path = /storage/.update
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/.update
[Videos]
path = /storage/videos
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/videos
[Music]
path = /storage/music
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/music
[TV Shows]
path = /storage/tvshows
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/tvshows
[Recordings]
path = /storage/recordings
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/recordings
[Downloads]
path = /storage/downloads
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/downloads
[Pictures]
path = /storage/pictures
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/pictures
[Emulators]
path = /storage/emulators
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/emulators
[Configfiles]
path = /storage/.config
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/.config
[Userdata]
path = /storage/.kodi/userdata
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/.kodi/userdata
[Screenshots]
path = /storage/screenshots
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/screenshots
[Logfiles]
path = /storage/logfiles
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/logfiles
root preexec = createlog
[Backup]
path = /storage/backup
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/backup
[HDD]
path = /var/media/sda1-ata-ST9320325AS_5VEA
available = yes
browsable = yes
public = yes
writeable = yes
force user = root
force group = root
And this is the smb.conf that appears on a read-only file system. Again, I think it's completely overridden:
################################################################################
# This file is part of OpenELEC - ...
# Copyright (C) 2009-2014 Stephan Raue ([email protected])
#
# OpenELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <...>.
################################################################################
# samba.conf
# This configuration file allows you to customize the samba shares
# available from your machine
[global]
server string = OpenELEC
workgroup = WORKGROUP
netbios name = %h
security = share
guest account = root
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
smb ports = 445
max protocol = SMB2
min receivefile size = 16384
deadtime = 30
os level = 20
mangled names = no
syslog only = yes
syslog = 2
name resolve order = lmhosts wins bcast host
preferred master = auto
domain master = auto
local master = yes
printcap name = /dev/null
load printers = no
browseable = yes
writeable = yes
printable = no
encrypt passwords = true
enable core files = no
passdb backend = smbpasswd
smb encrypt = disabled
use sendfile = yes
# Using the following configurations as a template allows you to add
# writable shares of disks and paths under /storage
[Update]
path = /storage/.update
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/.update
[Videos]
path = /storage/videos
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/videos
[Music]
path = /storage/music
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/music
[TV Shows]
path = /storage/tvshows
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/tvshows
[Recordings]
path = /storage/recordings
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/recordings
[Downloads]
path = /storage/downloads
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/downloads
[Pictures]
path = /storage/pictures
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/pictures
[Emulators]
path = /storage/emulators
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/emulators
[Configfiles]
path = /storage/.config
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/.config
[Userdata]
path = /storage/.kodi/userdata
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/.kodi/userdata
[Screenshots]
path = /storage/screenshots
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/screenshots
[Logfiles]
path = /storage/logfiles
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/logfiles
root preexec = createlog
[Backup]
path = /storage/backup
available = yes
browsable = yes
public = yes
writable = yes
root preexec = mkdir -p /storage/backup
The log file is all but non-existent:
[2015/05/21 09:52:27, 0] /home/stephan/projects/openelec-5.0/build.OpenELEC-RPi.arm-5.0.8/samba-3.6.25/source3/smbd/server.c:1074(smbd_main) smbd version 3.6.25 started. Copyright Andrew Tridgell and the Samba Team 1992-2011
Global
section:log file = /var/log/samba/log.machines
. Afterwards, restart samba:sudo service smbd restart
Try to connect to your share and examine afterwards the log file as defined above. Put it in your question as well.HDD
share appears. /var is a tmpfs so /var/log/samba disappears after every reboot, which I had to do, because OpenELEC doesn't doservice smbd restart
and I can't find the start up script. So I did /var/log/samba.log, but that file remains 0-length after I mountHDD
.