[Samba] pdbedit and tdbsam

David "3oz" Sonenberg pip_prime at yahoo.com
Fri Aug 6 16:05:26 GMT 2004


I'm having trouble using pdbedit to add user to a
tdbsam database.  I'm running Redhat Enterprise Linux
ES 3.0, with the stock version of samba.  I'm not sure
why it won't let me add users.  I tried it with
smbpasswd and that didn't work either.  Anyway here's
a plethora of information:

[root at samba root]# pdbedit -a -u root -d 10
INFO: Current debug levels:
  all: True/10
  tdb: False/0
  printdrivers: False/0
  lanman: False/0
  smb: False/0
  rpc_parse: False/0
  rpc_srv: False/0
  rpc_cli: False/0
  passdb: False/0
  sam: False/0
  auth: False/0
  winbind: False/0
  vfs: False/0
  idmap: False/0
  quota: False/0
  acls: False/0
lp_load: refreshing parameters
Initialising global parameters
params.c:pm_process() - Processing configuration file
"/etc/samba/smb.conf"
Processing section "[global]"
doing parameter netbios name = SAMBA
handle_netbios_name: set global_myname to: SAMBA
doing parameter workgroup = X3D
doing parameter passdb backend =
tdbsam:/etc/samba/secrets.tdb
doing parameter add user script = /usr/sbin/useradd -m
%u
doing parameter delete user script = /usr/sbin/userdel
=r %u
doing parameter add group script = /usr/sbin/groupadd
%g
doing parameter delete group script =
/usr/sbin/groupdel %g
doing parameter add user to group script =
/usr/sbin/usermod -G %g %u
doing parameter add machine script = /usr/sbin/useradd
-s /bin/false -d /dev/null %u
doing parameter os level = 33
doing parameter preferred master = yes
doing parameter domain master = yes
doing parameter local master = yes
doing parameter security = user
doing parameter domain logons = yes
doing parameter logon path = \\%N\profiles\%u
doing parameter logon drive = H:
doing parameter logon script = logon.bat
doing parameter wins support = yes
doing parameter syslog = 5
pm_process() returned Yes
lp_servicenumber: couldn't find homes
set_server_role: role = ROLE_DOMAIN_PDC
Attempting to register new charset UCS-2LE
Registered charset UCS-2LE
Attempting to register new charset UTF8
Registered charset UTF8
Attempting to register new charset ASCII
Registered charset ASCII
Attempting to register new charset 646
Registered charset 646
Attempting to register new charset ISO-8859-1
Registered charset ISO-8859-1
Attempting to register new charset UCS2-HEX
Registered charset UCS2-HEX
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Substituting charset 'UTF-8' for LOCALE
Trying to load: tdbsam:/etc/samba/secrets.tdb
Attempting to register passdb backend ldapsam
Successfully added passdb backend 'ldapsam'
Attempting to register passdb backend ldapsam_compat
Successfully added passdb backend 'ldapsam_compat'
Attempting to register passdb backend smbpasswd
Successfully added passdb backend 'smbpasswd'
Attempting to register passdb backend tdbsam
Successfully added passdb backend 'tdbsam'
Attempting to register passdb backend guest
Successfully added passdb backend 'guest'
Attempting to find an passdb backend to match
tdbsam:/etc/samba/secrets.tdb (tdbsam)
Found pdb backend tdbsam
pdb backend tdbsam:/etc/samba/secrets.tdb has a valid
init
Attempting to find an passdb backend to match guest
(guest)
Found pdb backend guest
pdb backend guest has a valid init
Netbios name list:-
my_netbios_names[0]="SAMBA"
Trying to load: tdbsam:/etc/samba/secrets.tdb
Attempting to find an passdb backend to match
tdbsam:/etc/samba/secrets.tdb (tdbsam)
Found pdb backend tdbsam
pdb backend tdbsam:/etc/samba/secrets.tdb has a valid
init
Attempting to find an passdb backend to match guest
(guest)
Found pdb backend guest
pdb backend guest has a valid init
Finding user root
Trying _Get_Pwnam(), username as lowercase is root
Get_Pwnam_internals did find user [root]!
pdb_set_username: setting username root, was
element 12 -> now SET
pdb_set_full_name: setting full name root, was
element 13 -> now SET
pdb_set_unix_homedir: setting home dir /root, was NULL
element 22 -> now SET
pdb_set_domain: setting domain X3D, was
pdb_set_user_sid: setting user sid
S-1-5-21-2351621536-730267382-1598341932-1000
element 18 -> now SET
pdb_set_user_sid_from_rid:
        setting user sid
S-1-5-21-2351621536-730267382-1598341932-1000 from rid
1000
pdb_set_group_sid: setting group sid
S-1-5-21-2351621536-730267382-1598341932-1001
element 19 -> now SET
pdb_set_group_sid_from_rid:
        setting group sid
S-1-5-21-2351621536-730267382-1598341932-1001 from rid
1001
Home server: samba
pdb_set_profile_path: setting profile path
\\samba\profiles\root, was
Home server: samba
pdb_set_homedir: setting home dir \\samba\root, was
pdb_set_dir_drive: setting dir drive H:, was NULL
pdb_set_logon_script: setting logon script logon.bat,
was
pdb_init_sam_new: no RID specified.  Generating one
via old algorithm
pdb_set_user_sid: setting user sid
S-1-5-21-2351621536-730267382-1598341932-1000
element 18 -> now SET
pdb_set_user_sid_from_rid:
        setting user sid
S-1-5-21-2351621536-730267382-1598341932-1000 from rid
1000
new password:
retype new password:
account_policy_get: maximum password age:-1
account_policy_get: minimum password age:0
tdb(unnamed): tdb_open_ex: /etc/samba/secrets.tdb
(2054,0) is already open in this process
Unable to open/create TDB passwd
tdb_update_sam: Unable to open TDB passwd
(/etc/samba/secrets.tdb)!
Unable to add user! (does it already exist?)

[root at samba root]# ls -al /etc/samba/
total 40
drwxr-xr-x    2 root     root         4096 Aug  5
11:34 .
drwxr-xr-x   61 root     root         4096 Aug  5
11:37 ..
-rw-r--r--    1 root     root           20 Jul 20
09:43 lmhosts
-rw-rw-rw-    1 root     root         8192 Aug  4
17:06 secrets.tdb
-rw-r--r--    1 root     root          875 Aug  5
11:19 smb.conf
-rw-r--r--    1 root     root        10704 Jul 20
09:43 smb.conf.rpmnew
-rw-r--r--    1 root     root           97 Jul 20
09:43 smbusers

[root at samba root]# cat /etc/samba/smb.conf

[global]
        netbios name = SAMBA
        workgroup = WORKGROUP
        passdb backend  =
tdbsam:/etc/samba/secrets.tdb

        # Scripts
        add user script = /usr/sbin/useradd -m %u
        delete user script = /usr/sbin/userdel =r %u
        add group script = /usr/sbin/groupadd %g
        delete group script = /usr/sbin/groupdel %g
        add user to group script = /usr/sbin/usermod
-G %g %u
        add machine script = /usr/sbin/useradd -s
/bin/false -d /dev/null %u

        os level = 33
        preferred master = yes
        domain master = yes
        local master = yes
        security = user
        domain logons = yes
        logon path = \\%N\profiles\%u
        logon drive = H:
        logon script = logon.bat
        wins support = yes
        syslog = 5

[netlogon]
        path = /var/lib/samba/netlogon
        read only = yes
        write list = ntadmin

[profiles]
        path = /var/lib/samba/profiles
        read only = no
        create mask = 0600
        directory mask = 0700




		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail


More information about the samba mailing list