[Samba] Using userpassword attribute with sha1 in samba4

Thiago Tenório thiago.aths at gmail.com
Wed Oct 2 07:17:37 MDT 2013


Hi everyone,

I have a php script that put all the people from a ldap(Openldap) base to
Samba4 so I need to use the same password.
I'm using userpassword in samba to store the passwords sha1 but I don't
understand what is happening. My user is not logging on the system.

Do I need to enable anything in samba4 ?

My script:

public function gerarSenhaPadraoTextoPlano($strSenha)
{
   $senha = "\"" . $strSenha . "\"";
   $novaSenha = null;

   $len = strlen($senha);

   for($i=0;$i<$len;$i++)
   $novaSenha .= "{$senha{$i}}\000";

   return $novaSenha;
 }

$ldaprecord['userpassword'] = $this->gerarSenhaPadraoTextoPlano("123Mudar");

-- 
Att,

*Thiago Holanda*


More information about the samba mailing list