Page 1 of 1

[SOLVED] Users not in SMB after reboot

Posted: 30 Jan 2019 19:37
by liam
Hi

My NAS is running 11.2.0.4 - Omnius (revision 6400)

I have 2 users who have SMB shares that they need to authenticate too. After I turned off AFP and went fully to SMB for their Time Machine targets I noticed that they were unable to connect to their SMB shares after a reboot. I can ssh in and do an 'smbpassword -a username' for each of them, and then it's all OK until the next reboot.

How do I get the smb user config to persist across reboots? I can't find anywhere in the web GUI to do the equivalent of the smbpassword command, and the change in the shell isn't persisted.

Thank you
Cheers, Liam

Re: Users not in SMB after reboot

Posted: 30 Jan 2019 22:35
by liam
To be clear, I know where the config.xml file it, and I know how to remount the filesystem rw to modify/replace the file. I think that passdb.tdb is the file is that gets updated running the smbpassword -a command. What I don't know is what needs to get entered in the config.xml file to recreate the users on a reboot.

Thanks, Liam

Re: Users not in SMB after reboot

Posted: 30 Jan 2019 23:50
by ms49434
liam wrote:
30 Jan 2019 19:37
Hi

My NAS is running 11.2.0.4 - Omnius (revision 6400)

I have 2 users who have SMB shares that they need to authenticate too. After I turned off AFP and went fully to SMB for their Time Machine targets I noticed that they were unable to connect to their SMB shares after a reboot. I can ssh in and do an 'smbpassword -a username' for each of them, and then it's all OK until the next reboot.

How do I get the smb user config to persist across reboots? I can't find anywhere in the web GUI to do the equivalent of the smbpassword command, and the change in the shell isn't persisted.

Thank you
Cheers, Liam
Create your users in Access > Users & Groups > Users
access_users.png
Set SMB/CIFS authentication to Local User
services_samba.png

Re: Users not in SMB after reboot

Posted: 31 Jan 2019 18:37
by liam
ms49434 wrote:
30 Jan 2019 23:50
Create your users in Access > Users & Groups > Users
access_users.png
Set SMB/CIFS authentication to Local User
services_samba.png
Thank you. My users were created in Access > Users & Groups > Users and SMB Auth is set to Local user however they are not in SMB after a reboot, and the only way I can make them work after a reboot is to ssh in and run smbpassword -a.

Cheers, Liam

Re: Users not in SMB after reboot

Posted: 31 Jan 2019 21:35
by raulfg3
are you sure that NOT run live version?.

Post a screen capture to be sure.

Re: Users not in SMB after reboot

Posted: 31 Jan 2019 21:57
by ms49434
liam wrote:
31 Jan 2019 18:37
ms49434 wrote:
30 Jan 2019 23:50
Create your users in Access > Users & Groups > Users
access_users.png
Set SMB/CIFS authentication to Local User
services_samba.png
Thank you. My users were created in Access > Users & Groups > Users and SMB Auth is set to Local user however they are not in SMB after a reboot, and the only way I can make them work after a reboot is to ssh in and run smbpassword -a.

Cheers, Liam
  • The GUI script under Access > Users & Groups > Users (access_users.php) writes to config.xml into <access><user>.
  • The rc script /etc/rc.d/passwd creates /var/etc/private/passdb.tdb file based on the information found in config.xml under <access><user>.
  • The rc script /etc/rc.d/samba creates /var/etc/smb4.conf with the information defined in Services > CIFS/SMB > Settings and Services > CIFS/SMB > Shares and also sets the password backend to tdbsam(smbpasswd to store user information is NOT used):

    smb passwd file = /var/etc/private/smbpasswd
    private dir = /var/etc/private
    passdb backend = tdbsam
pdbedit -L -v returns

Code: Select all

xigmanas: etc# pdbedit -L -v
---------------
Unix username:        7of9
NT username:          
Account Flags:        [U          ]
User SID:             S-1-5-21-782829325-2533275706-4084584263-1000
Primary Group SID:    S-1-5-21-782829325-2533275706-4084584263-513
Full Name:            Jeri Ryan
Home Directory:       \\xigmanas\7of9
HomeDir Drive:        
Logon Script:         
Profile Path:         \\xigmanas\7of9\profile
Domain:               XIGMANAS
Account desc:         
Workstations:         
Munged dial:          
Logon time:           0
Logoff time:          9223372036854775807 seconds since the Epoch
Kickoff time:         9223372036854775807 seconds since the Epoch
Password last set:    Thu, 31 Jan 2019 00:27:57 CET
Password can change:  Thu, 31 Jan 2019 00:27:57 CET
Password must change: never
Last bad password   : 0
Bad password count  : 0
Logon hours         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Re: Users not in SMB after reboot

Posted: 01 Feb 2019 23:04
by liam
My apologies if this shows up twice.

I much appreciate all the help, especially the pdbedit command. I tested with a new user, then deleted and recreated one of my users and their share. Turns out that back ni 2015 or so having UIDs in the 500s worked just fine, but sometime since then there is code that breaks things if you have a UID below 500. Creating a new user (UID 1000) produced the same lines in config.xml as my original users had. Deleting and recreating a user and the share didn't make it work, so I changed the UID in config.xml to 1xxx and it finally showed up in pdbedit. Final proof was just editing the config.xml for a user with a 5xx UID to change the UID to 1xxx without making any other changes, and rebooting. The system came up with the legacy user showing to pdbedit and their shares working.

Again, thanks for the pointers!
Cheers, Liam