LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   No smbpasswd in CentOS 6.4? (http://www.linuxquestions.org/questions/red-hat-31/no-smbpasswd-in-centos-6-4-a-4175459797/)

d420 04-27-2013 12:06 PM

No smbpasswd in CentOS 6.4?
 
I am in the process of migrating a Fedora Core 4 based Samba (3.0.23a-1.fc4.1) server to a CentOS 6.4 based Samba server (3.5.4-68.el6_0.2).

I thought that copying the config files in /etc/samba from the old server to the new one would suffice, but it turned out that the new server doesn't recognize the users/passwords in those files (smbpasswd, smbusers, secrets.tdb).

Once I started adding users manually (e.g. 'smbpasswd -a dfour'), all is well and I am able to connect from a remote client.

But... I also noticed that 'smbpasswd -a' operation did not touch any of the files in /etc/samba, nor created a new file.

So I'm curious: Where does 'smbpasswd -a' do the magic (of storing user information) now?

sag47 04-27-2013 12:14 PM

As root user I ran the following commands on my system.

Code:

yum provides $(which smbpasswd)
rpm -q --filesbypkg samba-common
cd /var/lib/samba/
ls

Looks like your user database is in /var/lib/samba. That is the case on my system. /var is normally used for variable data (such as databases).

SAM

d420 04-27-2013 12:24 PM

Quote:

Originally Posted by sag47 (Post 4940111)
Looks like your user database is in /var/lib/samba.

Thanks for reminding me about that directory. I just checked it and there are files with current timestamps:

Code:

-rw-r--r--. 1 root root  110592 Apr 27 13:15 connections.tdb
-rw-r--r--. 1 root root  204800 Apr 27 13:15 sessionid.tdb
-rw-r--r--. 1 root root    8192 Apr 27 13:15 serverid.tdb
-rw-------. 1 root root    12288 Apr 27 13:12 messages.tdb
-rw-r--r--. 1 root root    12288 Apr 27 13:12 printer_list.tdb
-rw-r--r--. 1 root root  425984 Apr 27 12:57 gencache_notrans.tdb
-rw-r--r--. 1 root root  425984 Apr 27 12:57 gencache.tdb
-rw-r--r--. 1 root root      696 Apr 27 11:03 notify_onelevel.tdb
-rw-r--r--. 1 root root      696 Apr 27 11:03 notify.tdb
-rw-r--r--. 1 root root    40200 Apr 27 11:03 locking.tdb
-rw-r--r--. 1 root root    40200 Apr 27 11:03 brlock.tdb
-rw-r--r--. 1 root root      258 Apr 27 08:54 browse.dat

But none seem to be updated when I run another 'smbpasswd -a` command.

So, I am still looking for the elusive users/password database. :)

d420 04-27-2013 12:26 PM

Quote:

Originally Posted by d420 (Post 4940114)
So, I am still looking for the elusive users/password database.

Update: I found passdb.tdb in /var/lib/samba/private.

Mystery solved. :)

Thank you.


All times are GMT -5. The time now is 05:33 AM.