Cliente CIFS se comportando como root no servidor

0

Eu tenho um cliente CIFS com um usuário comum. Eu tenho um servidor SAMBA onde o único usuário é raiz. Eu quero que o usuário no sistema cliente possa acessar os arquivos no servidor remoto como root. Até agora eu não posso, embora eu tenha usado opções como "uid", "setuid", etc. O cliente só vê os arquivos remotos como pertencentes a "root" e "permissão negada" é tudo que eu recebo.

O servidor, que executa OpenELEC , compartilhado com permissões de convidado, portanto, é improvável que a solução envolva alterações profundas no servidor. O cliente está executando o Ubuntu 14.04.02.

Este é o arquivo samba.conf, que eu acho que sobrescreve o smb.conf. Eu peguei de um modelo e adicionei apenas o último compartilhamento:

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

E este é o smb.conf que aparece em um sistema de arquivos somente para leitura. Mais uma vez, acho que é completamente substituído:

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

O arquivo de log é praticamente inexistente:

[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

    
por Opux 21.05.2015 / 02:53

1 resposta

1

Encontrei uma solução um pouco suja:

  1. Iniciar o PCManFM
  2. Navegue até o compartilhamento smb, abrindo
  3. Quando uso outro aplicativo que não conhece o smb, descubro que o compartilhamento está disponível no navegador de arquivos. Provavelmente, isso acontece porque está em /run/user/1000/gvfs/

Terrível, mas faz o trabalho. Provavelmente há uma solução mais limpa envolvendo gvfs, que provavelmente obteria a melhor resposta.

    
por Opux 30.05.2015 / 17:13