LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-06-2014, 07:40 PM   #1
cele_82
LQ Newbie
 
Registered: May 2014
Posts: 4

Rep: Reputation: Disabled
LDAP password generation


Hi,
I have a quick question, probably easy for someone that knows already how this works.

If using this command to generate an LDAP password

Quote:
[root@CENTOS6 ~]# slappasswd -s password -h '{CRYPT}'
{CRYPT}br7QH37oXbKf6
[root@CENTOS6 ~]# slappasswd -s password -h '{CRYPT}'
{CRYPT}Sf/rqvVc3Usvc
[root@CENTOS6 ~]# slappasswd -s password -h '{CRYPT}'
{CRYPT}SVWRaOz3rjmGA
[root@CENTOS6 ~]# slappasswd -s password -h '{CRYPT}'
{CRYPT}n2J0VEfyLj55g
[root@CENTOS6 ~]# slappasswd -s password -h '{CRYPT}'
{CRYPT}CjO854tVYj.WU
I get a password different all the time. I guess it's because it's salted ? What I don't understand is why is it changing all the time I ran the command ? Is it based on some hardware clock or random numbers ?

IF so how the client and server can agree on the a successful login ? Is hte client encrypting password and then matching that somehow with a password stored in a file ?

Please help me to understand this.
Thanks!
 
Old 05-12-2014, 05:51 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Start by reading a little farther along in man slappasswd:
Quote:
-c crypt-salt-format
Specify the format of the salt passed to crypt(3) when generating {CRYPT} passwords. This string needs to be in sprintf(3) format and may include one (and only one) %s conversion. This conversion will be substituted with a string of random characters from [A-Za-z0-9./]. For example, '%.2s' provides a two character salt and '$1$%.8s' tells some versions of crypt(3) to use an MD5 algorithm and provides 8 random characters of salt. The default is '%s', which provides 31 characters of salt.
[ ... ]
The hashed password values should be protected as if they were cleartext passwords.
So ... (some might add, "of course ...") the hash is salted. So, a very large number of 'different' strings can be used to convey the same secret.

Last edited by sundialsvcs; 05-12-2014 at 05:56 AM.
 
Old 05-12-2014, 08:15 AM   #3
cele_82
LQ Newbie
 
Registered: May 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thank you very much for your answer. Could you explain me how client and server can agree a login ? I mean I'm not sure if the client sends the password securely to server and the server encrypt that and matches it to the one in the file/database.

If so, I don't understand how this works ? I mean if the hash always changes how the server can compare it to the hash of the password used for login ? Is the salt always the same ?



Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LDAP password naivelinux Linux - General 2 07-04-2008 03:41 AM
[SOLVED] uuencode for random password generation with /dev/urandom JZL240I-U SUSE / openSUSE 27 09-06-2007 01:00 AM
Password generation failed for scheme {CRYPT}: scheme not recognized olva Linux - General 0 11-05-2006 11:21 AM
Compare LDAP password with php crypt password coolamit78 Linux - Networking 1 01-30-2006 05:35 AM
Strong password generation Lindy Linux - Software 2 12-27-2003 07:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration