Re: script wrapper for smbpasswd?



Davide Bianchi wrote:
On 2007-08-31, The Natural Philosopher <a@xxx> wrote:
Yeah..but how..

step one, setup an ldap server (www.openldap.org)
step two, configure the machine to authenticate using ldap
step three, activate the ldap backend on samba (www.samba.org)

The only problem is how to do step two, on redhat and derivative
just run authconfig.

Davide

I've done a bit of playing around, and managed to run smbpasswd and usermod silently from command line stuff, so a setuid script looks like the quickest hack to get me there. Its not a huge installation..just a half dozen guys using a machine as the company data server and needing a simple way to get user passwords changed and users added from a web page. Its all behind a firewall and none of them would want or know how to do password sniffing and the like.

As root I could use

echo -e "password\npassword\n" | smbpasswd username

and

usermod -p hashed-password username.

I can generate a hashed password already to DES standard using php, so its all fairly crude. I could even write some C to munge the /etc/shadow file..its not a lot of trouble really.

I\'ll call the script something obscure and put in in an unlikely place...

Oh..has anyone got C source for crypt()?

I couldn't find anything simple on the normal libraries.
In some way instead of a script I'd rather use a C program..less chance of it getting 'altered' especially if I remove the source..
.