Permission issues with OH 3.4

Hi!

I’m getting super frustrated… please help me…
Accidentaly I’ve updated my whole OH 3.1 stable image to 4.0 and it stopped booting.
Only solution was to reinstall openhabian 3.4 from clean image and then copy back all my saved items/things etc.

Now this is where my problem begins…
After a successful reinstall, I’ve set up a super basic config, where I can reach the device on a specific IP.
Can connect to it via SSH, with openhabian user.
I can mount the RPI on my Win10 PC, can access the folders (config,userdata, sys etc), but do not have write permission.

What I’ve already done.
Restarted OH several times. Used the fix permissions improvement menu (did not help at all)
Changed SMB and other passwords for default (openhabian).
Have modified the smb.conf file to be public for all shared folders, so I can see them but can not write them from Win10 PC.

This is really frustrating because I did not have any problems with mounting and accessing the device on 3.1, so something is chnaged since that rlz. Or I’m missing something from the big picture…

Also the mount network drive from windows is not working. It does not accept the openhabian-openhabian user-pw combo.
Connecting to the device via Totalcmd is working (openhabian-openhabian credentials) but have no write permissions…

I’ve SMB 1.0 and all other features installed on the Win10 PC, also in the same workgroup with no VLANs in the network.

What am I missing? Why is this smb share not working properly and why can’t I mount the rpi drive to my windows and copy back my saved files?! :exploding_head:

Your statement sounds like you are in panic mode.
Panic mode isn’t any good advisor.

What exactly did you do here:

This sentence itself sounds like an explanation … without knowing what you exactly did it is hard to say.

  • what the content of your smb.conf file ?
  • what are the permissions of the directories and files on linux level
    ls -lR /srv/openhab-conf/ /etc/openhab/
  • as long as SMB does not work you may have a look at filezilla
    filezilla can be used to exchange files via ssh/sftp protocoll; try if that works in the meantime

Hi Wolfgang_S!

Thanks for the quick response!

I’m not in panic mode, I’m just frustrated because the whole smarthome stopped working 1.5 days ago, just before Christmas when I’d have a ton of things to do :smiley:

openhabian@openhabian:/ $ cat etc/samba/smb.conf
#
# 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.

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

[global]

## Browsing/Identification ###

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

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
  wins support = yes

# 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

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

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone server" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
  server role = standalone server

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

#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or '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

# 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

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

;[homes]
 ;comment = Home Directories
 ;browseable = yeso
 ;valid users = %S
 ;writeable = yes
 ;create mask = 0700
 ;directory mask = 0700

;[printers]
;   comment = All Printers
;   browseable = no
;   public = no
;   path = /var/spool/samba
;   printable = yes
;   guest ok = no
;   read only = yes
;   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
;[print$]
;   comment = Printer Drivers
;   path = /var/lib/samba/printers
;   browseable = no
;   public = no
;   read only = yes
;   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

#=================== Custom Share Definitions ====================

[openHAB-share]
  comment=openHAB combined folders
  path=/srv
  writeable=yes
  public=yes
  create mask=0664
  directory mask=0775
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

[openHAB-addons]
  comment=openHAB addons
  path=/usr/share/openhab/addons
  writeable=yes
  public=yes 
  create mask=0664
  directory mask=0775
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

[openHAB-conf]
  comment=openHAB site configuration
  path=/etc/openhab
  writeable=yes
  public=yes
  create mask=0664
  directory mask=0775
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

[openHAB-userdata]
  comment=openHAB userdata
  path=/var/lib/openhab
  writeable=yes
  public=yes
  create mask=0664
  directory mask=0775
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

[openHAB-sys]
  comment=openHAB application
  path=/usr/share/openhab
  writeable=yes
  public=yes
  create mask=0664
  directory mask=0775
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

; ATTENTION: /var/log is on zram
; Sharing this will cause data loss of logs
; You *can* uncomment this but you have been warned
[openHAB-logs]
  comment=openHAB log files
  path=/var/log/openhab
  writeable=yes
  public=yes
  create mask=0664
  directory mask=0775
  veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/
  delete veto files = yes

# vim: filetype=samba
openhabian@openhabian:/ $ ls -lR /srv/openhab-conf/
/srv/openhab-conf/:
total 48
drwxrwxr-x 4 openhab openhab 4096 Dec 21 13:17 automation
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 html
drwxrwxr-x 3 openhab openhab 4096 Dec 21 13:08 icons
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 items
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 persistence
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 rules
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 scripts
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:24 services
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 sitemaps
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 sounds
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 things
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 transform

/srv/openhab-conf/automation:
total 8
drwxrwxr-x 3 openhab openhab 4096 Dec 21 13:18 js
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:14 jsr223

/srv/openhab-conf/automation/js:
total 12
drwxrwxr-x 3 openhab openhab 4096 Dec 21 13:18 node_modules
-rw-rw-r-- 1 openhab openhab   64 Dec 21 13:18 package.json
-rw-rw-r-- 1 openhab openhab  767 Dec 21 13:18 package-lock.json

/srv/openhab-conf/automation/js/node_modules:
total 4
drwxrwxr-x 4 openhab openhab 4096 Dec 21 13:18 openhab_rules_tools

/srv/openhab-conf/automation/js/node_modules/openhab_rules_tools:
total 96
-rwxrwxr-x 1 openhab openhab  2712 Dec 21 13:18 countdownTimer.js
-rwxrwxr-x 1 openhab openhab  1793 Dec 21 13:18 deferred.js
-rwxrwxr-x 1 openhab openhab  2153 Dec 21 13:18 gatekeeper.js
-rwxrwxr-x 1 openhab openhab  5435 Dec 21 13:18 groupUtils.js
-rw-rw-r-- 1 openhab openhab  1388 Dec 21 13:18 helpers.js
-rwxrwxr-x 1 openhab openhab   615 Dec 21 13:18 index.js
-rw-rw-r-- 1 openhab openhab 13943 Dec 21 13:18 LICENSE
-rwxrwxr-x 1 openhab openhab  1632 Dec 21 13:18 loopingTimer.js
-rwxrwxr-x 1 openhab openhab     0 Dec 21 13:18 multiPressProfile.js
-rwxrwxr-x 1 openhab openhab   633 Dec 21 13:18 package.json
-rwxrwxr-x 1 openhab openhab   687 Dec 21 13:18 rateLimit.js
-rw-rw-r-- 1 openhab openhab  7563 Dec 21 13:18 README.md
-rwxrwxr-x 1 openhab openhab  6668 Dec 21 13:18 rulesUtils.js
drwxrwxr-x 2 openhab openhab  4096 Dec 21 13:18 tests
-rwxrwxr-x 1 openhab openhab   510 Dec 21 13:18 testUtils.js
-rwxrwxr-x 1 openhab openhab  3632 Dec 21 13:18 timerMgr.js
-rwxrwxr-x 1 openhab openhab  9736 Dec 21 13:18 timeUtils.js

/srv/openhab-conf/automation/js/node_modules/openhab_rules_tools/tests:
total 48
-rwxrwxr-x 1 openhab openhab 4128 Dec 21 13:18 countdownTimerTests
-rwxrwxr-x 1 openhab openhab 2826 Dec 21 13:18 deferredTests
-rwxrwxr-x 1 openhab openhab 4395 Dec 21 13:18 gatekeeperTests
-rwxrwxr-x 1 openhab openhab 2039 Dec 21 13:18 groupUtilsTests
-rwxrwxr-x 1 openhab openhab  725 Dec 21 13:18 loopingTimerTests
-rwxrwxr-x 1 openhab openhab 1070 Dec 21 13:18 rateLimitTests
-rwxrwxr-x 1 openhab openhab 4626 Dec 21 13:18 timerMgrTests
-rwxrwxr-x 1 openhab openhab 6008 Dec 21 13:18 timeUtilsTests

/srv/openhab-conf/automation/jsr223:
total 0

/srv/openhab-conf/html:
total 8
-rw-rw-r-- 1 openhab openhab 451 Dec 19 08:38 index.html
-rw-rw-r-- 1 openhab openhab 282 Dec 19 08:38 readme.txt

/srv/openhab-conf/icons:
total 4
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 classic

/srv/openhab-conf/icons/classic:
total 4
-rw-rw-r-- 1 openhab openhab 289 Dec 19 08:38 readme.txt

/srv/openhab-conf/items:
total 4
-rw-rw-r-- 1 openhab openhab 231 Dec 19 08:38 readme.txt

/srv/openhab-conf/persistence:
total 4
-rw-rw-r-- 1 openhab openhab 256 Dec 19 08:38 readme.txt

/srv/openhab-conf/rules:
total 4
-rw-rw-r-- 1 openhab openhab 223 Dec 19 08:38 readme.txt

/srv/openhab-conf/scripts:
total 4
-rw-rw-r-- 1 openhab openhab 236 Dec 19 08:38 readme.txt

/srv/openhab-conf/services:
total 56
-rw-rw-r-- 1 openhab openhab  1691 Dec 19 08:38 addons.cfg
-rw-rw-r-- 1 openhab openhab   425 Dec 21 13:24 basicui.cfg
-rw-rw-r-- 1 openhab openhab   333 Dec 19 08:38 readme.txt
-rw-rw-r-- 1 openhab openhab   551 Dec 21 13:24 rrd4j.cfg
-rw-rw-r-- 1 openhab openhab 38620 Dec 21 13:17 runtime.cfg

/srv/openhab-conf/sitemaps:
total 4
-rw-rw-r-- 1 openhab openhab 230 Dec 19 08:38 readme.txt

/srv/openhab-conf/sounds:
total 112
-rw-rw-r-- 1 openhab openhab   8776 Dec 19 08:38 barking.mp3
-rw-rw-r-- 1 openhab openhab 102399 Dec 19 08:38 doorbell.mp3

/srv/openhab-conf/things:
total 4
-rw-rw-r-- 1 openhab openhab 234 Dec 19 08:38 readme.txt

/srv/openhab-conf/transform:
total 12
-rw-rw-r-- 1 openhab openhab  38 Dec 19 08:38 de.map
-rw-rw-r-- 1 openhab openhab  38 Dec 19 08:38 en.map
-rw-rw-r-- 1 openhab openhab 282 Dec 19 08:38 readme.txt

openhabian@openhabian:/ $ ls -lr /etc/openhab
total 48
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 transform
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 things
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 sounds
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 sitemaps
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:24 services
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 scripts
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 rules
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 persistence
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 items
drwxrwxr-x 3 openhab openhab 4096 Dec 21 13:08 icons
drwxrwxr-x 2 openhab openhab 4096 Dec 21 13:09 html
drwxrwxr-x 4 openhab openhab 4096 Dec 21 13:17 automation

In the meantime I’ll give Filezilla a try :slight_smile:

Did you use smbpasswd to change openhabians password resp. openhabian-config to change the samba users ( openhabian ) password ?

I think you changes - giving public access - do not work because anonymous users are still mapped to bad user. Mapping would have to be done to a user that has enough privileges and exists in the system.

map to guest = bad user

Sorry for late answer…
I was able to get the workaround with the filezilla.

I have tried to change smbpasswd for user openhabian with the command “sudo smbpasswd openhabian”. Still I can connect to the device from Win10, but have no write permission.

Also I have tried to change the passwd within openhabian-config but got the same result.

With filezilla, I have copied back all my files to the rpi so I got my smarthome up and running.

Still I have problems mounting the drive from the Win10 PC. I can not mount the whole device, but I can mount specific directories. Such as \192.168.1.100\openHAB-share.
Although that mounting is working, I can not modify anything on it, I have read only permissions with openhabian user :open_mouth:

The openHAB specific folders belong to user/group openhab, not openhabian, therefore I would call it correct not having write permission under that user.

Please check if user openhabian is member of openhab group.

what does that mean ? There are only specific directories exported via samba so only these can be mounted.

As hmerk stated check if openhabian belongs to group openhab. This is the default in openhabian.
To check this you can executed the command

id openhabian

wich amongst other information will show the groups openhabian belongs to.

If you still cannot login with a password then together with the changes you did to the smb.conf file you are able to get the directory mounted but read only as the connection is mounted as guest and a guest is mapped as a bad user. That mapping would have to be changed to user openhabian.
But all this is not a solution but a ( dirty ) workaround for the real problem.