Samba users not added untill they logon first? Edit: How do I add users to tdbsam without a password prompt?
Posted
by
glisignoli
on Server Fault
See other posts from Server Fault
or by glisignoli
Published on 2010-09-21T03:47:51Z
Indexed on
2011/01/02
15:55 UTC
Read the original article
Hit count: 238
I add users to my server with the command useradd -m -p PASS_HASH -s /usr/sbin/nologin USERNAME
Then I try to access their samba home share, but it never shows up until I login with the user:
root:~$sudo login failtest
Password:######
Added user failtest.
Is there some way of added the user without logging in?
Edit: The problem is that the user is added with the useradd command, but ubuntu seems to run an initalisation script when the user logs on for the first time. This script then adds that user to the tdbsam user database. Finding the initalisation script or the method it uses to add a user to the tdbsam database without requiring any user input (as smbpasswd -a USER prompts the user for a password).
So all I need is a way to add a user+pass to the tdbsam database without prompting a user for a password (eg: samaba-add-user.sh USERNAME PASSWORD).
© Server Fault or respective owner