LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-26-2009, 08:16 AM   #1
Amy84
LQ Newbie
 
Registered: Aug 2009
Location: Netherlands
Distribution: CentOS 5.3
Posts: 27

Rep: Reputation: 15
Samba smbpasswd file missing


Hey all,

For backing up a server I wanted to set up my Samba. Having done this before I started with changing my smb.conf
After doing so I didn't look any further and stated this command right away:

smbpasswd -a user

This gave me a bunch of errors (which unfortunately I'm not able to reproduce), but at the end it stated my user was added. Of course I didn't thick so and wanted to checkout my smbpasswd file. I was very surprised to find out there was no smbpasswd file there! (/etc/samba/smbpasswd)

So I search google. There was someone saying you can just make your own with the following command:

touch smbpasswd

I have absolutely no idea what that does, but it tried it anyway. It did create smbpasswd. I tried to add my user again. It came up like this:

[root@dowiki01 samba]# smbpasswd -a twadmin
New SMB password:
Retype new SMB password:

Which looks like there is something already there. Looking in my newly created file it was empty.

Now I ended up having two questions:

1.) What did I actually create using touch?
2.) How can solve my smbpasswd issue?

(I using CentOS 5.3 btw)

Thanks in advance.
 
Old 08-26-2009, 08:37 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
Check your smb.conf file for what your password backend is. (passdb backend =). If it isn't listed, the smbpasswd file is the default.

The touch command will update the timestamp on an existing file, and create a new file if it doesn't exist. You might try restarting samba.
Also make sure that the user you are trying to add exists in /etc/passwd. Otherwise smbpasswd will fail and not add the new user.
 
Old 08-26-2009, 09:03 AM   #3
Amy84
LQ Newbie
 
Registered: Aug 2009
Location: Netherlands
Distribution: CentOS 5.3
Posts: 27

Original Poster
Rep: Reputation: 15
Thanks for replying.

In my conf:
passdb backend = tdbsam

I checked my user in /etc/passwd and it does existed. Then I restarted my smb. Didn't work though.
 
Old 08-26-2009, 09:12 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Amy84 View Post
Thanks for replying.

In my conf:
passdb backend = tdbsam

I checked my user in /etc/passwd and it does existed. Then I restarted my smb. Didn't work though.
in this case, the smbpasswd file should be
Code:
/etc/samba/passdb.tdb


Code:
file passdb.tdb
passdb.tdb: TDB database version 6, little-endian hash size 131 bytes
because of that format, you cannot just create it using touch and expect it to work.

taken from
Code:
/usr/share/doc/samba-3.0.28/htmldocs/Samba3-HOWTO/passdb.html

In a strict sense, there are three supported account storage and access systems. One of these is considered
obsolete (smbpasswd). It is recommended to use the <code class="literal">tdbsam</code> method for all simple systems. Use
<code class="literal">ldapsam</code> for larger and more complex networks.


check content of this passdb file

Code:
strings passdb.tdb

Last edited by centosboy; 08-26-2009 at 09:14 AM.
 
1 members found this post helpful.
Old 08-26-2009, 09:18 AM   #5
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
tdbsam is a different password backend than the smbpasswd file.
Run "sudo /usr/bin/pdbedit -L" and see if the user is in it. If you didn't add the user as a Linux user first, you may need to rerun smbpasswd again.

You can use either smbpasswd or pdbedit program to manage the tdbsam account database.
 
Old 08-26-2009, 07:42 PM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Try

tdbdump

if you have /etc/samba/passdb.tdb
 
Old 03-15-2011, 09:36 AM   #7
hlavalle
LQ Newbie
 
Registered: Mar 2011
Posts: 1

Rep: Reputation: 0
I know that this thread has not been replied for a long time, but as it helped me, I decided to leave here what I found.

Code:
man smb.conf
Then look for "passdb backend (G)"

In my case (Ubuntu 10.04), with tdbsam, the file is at /var/lib/samba/passdb.tdb

With smbpasswd, you have the /etc/samba/smbpasswd, that is created when you add users with the "smbpasswd -a <user>" command.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SAMBA - smbpasswd not working !! the_reen Linux - Networking 2 06-16-2012 04:51 PM
adding users using smbpasswd, or synchronise passwd/smbpasswd gyodai Linux - Networking 2 03-11-2009 03:47 PM
ctime of /etc/samba/smbpasswd different ddaas Linux - Security 0 07-04-2005 02:42 AM
Samba: smbpasswd is set to NO PASSWORD linlu Linux - Networking 6 06-16-2005 02:44 PM
Missing samba file???? 3inone Linux - Networking 2 08-10-2003 07:44 PM


All times are GMT -5. The time now is 07:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration