A few weeks ago i published a Quick and Easy Samba Configuration Guide, which can be found here. After messing around with samba on and off since then I have learned a few things that I wanted to document before I totally forgot them. So lets down to business.
Samba Password Failures
So I have read a few things here and there that say that passwords can be a sticky issue in samba. Such was the case for me when I was trying to set a simple password of “myuser” for the user myuser.
As you can see below I got a bit of output from the command however in the end I was able to add the user, I quick check of google showed that the output below was supposed to be bogus anyway.
# smbpasswd -a myuser
New SMB password:
Retype new SMB password:
tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /var/lib/samba/private/passdb.tdb file.
for type 1 (min password length), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0
account_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0Added user myuser
But when I attempted to test with the samba client I got the following error
# smbclient -L localhost -U myuser
Enter myuser’s password:
session setup failed: NT_STATUS_LOGON_FAILURE
So at this point I decided to change the password to something more complex and tried again and this time no issues at all. Just to be cheeky, I then changed the password for myuser back to “myuser” and it worked again.
Lesson learned here if if you see this message try changing your password to something else.
Troubleshooting Samba Share Write Issues
Holy Cow, this one was driving me nuts and I probably spent a good hour trying to fix it. And the fix was super easy. Below I am just trying to put a file on the share using smbclient
# smbclient //localhost/samba -U myuser
Enter myuser’s password:
Domain=[WORKGROUP1] OS=[Unix] Server=[Samba 3.5.10-125.el6]
smb: \> put /var/tmp/test test
NT_STATUS_ACCESS_DENIED opening remote file \test
I tried selinux, various smb.conf changes, checking ip tables, and in the end the issue was as simple as permissions on the directory
chmod 2775 /shared/samba
Once I set this everything worked fine.
Additional Smb.conf Configuration Items
Just do get samba up and running on a basic level you don’t really have to know too many configuration directives, and most of those are documented in smb.conf anyway. However there are a few more options that I think are either useful or interesting. They are below.
admin users – a user configured as an admin user can perform actions as root.
invalid users – any user here is denied access, even if the group that the user is a member of has access.