LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Migrating a Samba server from CentOS to Slackware... where's the 'smbpassd' file? (https://www.linuxquestions.org/questions/slackware-14/migrating-a-samba-server-from-centos-to-slackware-wheres-the-smbpassd-file-908405/)

kikinovak 10-16-2011 03:24 AM

Migrating a Samba server from CentOS to Slackware... where's the 'smbpassd' file?
 
Hi,

I'm currently migrating a Samba file server from CentOS to Slackware (because the latter has a more convenient release policy). I'm experimenting a lot with a Sandbox network consisting of a Slackware server, two Windows XP clients as well as a Slack+KDE client.

Let's say I want to setup a simple no-frills password-protected share for the LAN. Here's my very simple smb.conf file for this:

Code:

[global]
  workgroup = MICROLINUX
  netbios name = BERNADETTE
  server string = Serveur de fichiers BERNADETTE
  security = user
  encrypt passwords = yes
  browseable = yes
  hosts allow = 192.168.2. 127.

[confidentiel]
  path = /export/confidentiel
  comment = Microlinux Partage Confidentiel
  read only = no

Now I want to have one 'microlinux' user for that. Here's how I go about it:

Code:

# useradd -g users -s /bin/false -c "Samba User" microlinux
# smbpasswd -a microlinux

I tested this setup, and on both Windows and Linux clients, the 'microlinux' user can connect to the share with his password. (I didn't setup a system password, only a Samba password, BTW.)

Now the first obvious difference between Samba on CentOS 5.7 and Samba on Slackware 13.37 is the missing /etc/samba/smbpasswd file. On the CentOS server, when I wanted to list my Samba users, it boiled down to this:

Code:

# cat /etc/samba/smbpasswd
This file is not present on Slackware, so I think Samba on Slackware stores user information differently.

Now what would I have to do to simply list my Samba users? The 'smbpasswd' manpage doesn't have this option.

Any suggestion?

kikinovak 10-16-2011 03:29 AM

I'll partially answer that myself. Still don't know where Samba keeps user information, but it looks like I've just found the command to list valid Samba users:

Code:

# pdbedit -L

dive 10-16-2011 03:51 AM

Code:

ls /etc/samba/private/
passdb.tdb  secrets.tdb  smbpasswd


kikinovak 10-16-2011 04:04 AM

Quote:

Originally Posted by dive (Post 4499658)
Code:

ls /etc/samba/private/
passdb.tdb  secrets.tdb  smbpasswd


I haven't got that file.

mRgOBLIN 10-16-2011 04:27 AM

That's the right place but the files won't exist until you create your first user.

Alien Bob 10-16-2011 04:49 AM

Apparently your old CentOS server is using an old version of Samba, or it carries some legacy from earlier installations.
The smbpasswd file has been deprecated and accounts are now stored either in LDAP or in a TDB database.
Comment in the /etc/smb.conf file:
Code:

# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
;  passdb backend = tdbsam

Your new server uses tdbsam and therefore you can not find a smbpasswd file. That is all in order.
Samba users can still be added through smbpasswd but pdbedit is newer and better suited.

Eric

kikinovak 10-16-2011 05:42 AM

Thanks for the clarification, Eric. By the way, I discovered your Samba HOWTO, but it's not dated. Before I dive into what looks like a nice tutorial (thanks again!), I wonder if the information contained in it still applies to Slackware 13.37.

hen770 10-16-2011 06:20 AM

What about the smbpasswd utility, is there a new one too?


All times are GMT -5. The time now is 03:57 PM.