Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

While trying to setup samba on an NFS server I deleted (don't ask) the /var/lib/samba/ contents and now when I try to start samba, this messages appears :

[2012/07/06 08:19:07.528973,  0] passdb/secrets.c:73(secrets_init)
  Failed to open /var/lib/samba/private/secrets.tdb
[2012/07/06 08:19:07.689735,  0] passdb/secrets.c:73(secrets_init)
  Failed to open /var/lib/samba/private/secrets.tdb
[2012/07/06 08:19:07.690078,  0] smbd/server.c:1240(main)
  ERROR: smbd can not open secrets.tdb

So how do I recreate the secrets.tdb file and the rest of the needed files if any ?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Use smbpasswd which will create the file if it doesn't exist when you add a new user

ls -l /var/lib/samba/private/secrets.tdb
ls: cannot access /var/lib/samba/private/secrets.tdb: No such file or directory

smbbpasswd iain
New SMB password:
Retype new SMB password:

ls -l /var/lib/samba/private/secrets.tdb
-rw-------. 1 root root 45056 Jul  6 07:54 /var/lib/samba/private/secrets.tdb
share|improve this answer
    
This only works is the directory /var/lib/samba/private exists. If it doesn't just make it via mkdir then execute the smbpasswd -a user –  Karl Morrison Jun 24 at 17:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.