Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On my linuxbox i have installed mandriva pwp 2009 and running samba.
suddenly the shared folders stoped working and ive found out that my smbpasswd db is corrupted (build_sam_account: smbpasswd database is corrupt! username xxxx with uid 504 is not in unix passwd database!)
i tried to create a new user with the same uid but the result was the same.
for a week now im reading various posts on net with similar problems but unfortunately i have no results.
Is there any way to repair the errors in smbpasswd database?
except that, is there any way to find out the "original" uid's and gid's of linux? (like adm, smbguest, e.t.c.)
Run "grep 504 /etc/passwd /etc/samba/passwd" and see who has that UID. If you installed a fresh distro, maybe the UIDs are different on that host and don't match what is in the /etc/samba/smbpasswd database.
You can delete an entry in the smbpasswd file with "sudo smbpasswd -x <username>" or manually delete the line in /etc/samba/smbpasswd and than re-add it. The smbpasswd command is used to add/remove users & change passwords in the /etc/samba/smbpasswd file.
I used the command pdbedit -i smbpasswd -e and i got no errors.
i created a new user with the name newbie. I changed the password of that user and i used the 123456 (only to see if is working) and i imported the users in samba (via webmin) then i got this error.
Failed to convert user : /usr/bin/pdbedit failed : add_smbfilepwd_entry: entry with name xxx already exists
For any case, i have an order copy of users i use in samba. If i delete the file which stores the users and the password db,
is it possible to fix the error?
I think that I misread your first message. Could you post the General part of your smb.conf file. Determining whether you are using smbpasswd or SAM would be a start.
I think that you were using a migration tool to go from using smbpasswd to using the SAM database. I don't know why you were doing that or which database type you are using.
Is the new Mandriva install on the server or the client?
Mandrive starts new user IDs at 500. SuSE starts them at 1000. Do you have a user with the same username but different UID?
I'm not certain if that would be a problem (due to cifs support).
Also what do you have for the line "Security ="? Is it "Security = User"?
The mandriva is a clean install on server, and the lowest uid is the 500 (for users).
At first time i tried to have different gid for users due to quota.
Every time i created a user (when everything was working well) i used the group "users" in samba and enabled a quota for users (10Gb each). Suddenly i discovered that the whole group "users" shared 10Gb of space instead of every user in group.
I managed to solve this problem for a few users by doing the following.
I removed the user from "users" group and i created a new group same as the username and i enabled quota for that user. When suddenly stoped working (bleh, the newbie life is never an easy thing)
here is my smb.conf
Here we are,
[global]
log file = /var/log/samba/samba.log
obey pam restrictions = yes
preserve case = yes
short preserve case = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
username level = 6
hostname lookups = yes
follow symlinks = no
interfaces = 127.0.0.1/8 192.168.0.0/24
domain master = no
encrypt passwords = yes
hosts allow = 127. 192.168.0/24
name resolve order = wins host bcast
client plaintext auth = no
password level = 6
netbios name = Samba
cups options = raw
wide links = no
server string = Samba file and print server
workgroup = Workgroup
os level = 33
printcap name = cups
security = user
bind interfaces only = yes
max log size = 50
winbind cache time = 360
pam password change = yes
winbind rpc only = yes
[homes]
map archive = no
browseable = no
locking = no
writable = yes
preserve case = no
path = /home
comment = Home Directories
valid users = %U
share modes = no
short preserve case = no
case sensitive =
[printers]
comment = All Printers
path = /var/spool/samba
printable = yes
share modes = no
locking = no
[pdf-documents]
path = /home/pdf-documents
comment = Converted PDF Documents
read only = no
guest ok = yes
[pdf-printer]
path = /tmp
comment = PDF Printer Service
printable = yes
guest ok = yes
use client driver = yes
printing = bsd
print command = /usr/bin/gadmin-samba-pdf %s %u
[Downloads]
path = /home/public/
comment = No comment
create mode = 777
read only = no
available = yes
browseable = yes
writable = yes
guest ok = yes
public = yes
printable = no
share modes = no
locking = no
I hadn't noticed the "share modes" before. From the manpage:
You should NEVER turn this parameter off as many Windows applications will break if you do so.
Default: share modes = yes
I thought I would attach the smb.conf file for my laptop, as the services are similar.
I use NFS predominately and have the same UID on all Linux machines, including another laptop with Fedora which normally starts UIDs at 500 instead of 1000.
I'm not certain if mounting with the type cifs would cause a problem if the UIDs of a user was different on two computers. Mounting a share with the cifs type allows using even using setfacl.
Sorry for the late respond but during the weekend i did various tests.
For every error i got in smbpasswd, i created a user with same uid till all errors stoped
Via webmin in user creation, i told to the system to increase the uid/gid for every new user from 500 to 600 and i started adding users/groups.
Right after restart of samba, the new users was able to use their personal files
(i have some minor broblems left but is another case).
I would like to thank everyone for your valuable help
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.