How to generate the hash in /etc/shadow


 
Thread Tools Search this Thread
Operating Systems Linux How to generate the hash in /etc/shadow
# 1  
Old 01-18-2010
How to generate the hash in /etc/shadow

Hey guys,

i've got some serious problems creating a hash for the /etc/shadow. I try to understand how linux creates this hash. Till now i understood that the $6$ shows me that my ubuntu 9.10 uses sha512 to create the hash. I also understood that the "salt"-thing makes the whole think much more secure, but can someone please explain how the WHOLE thing works? Is the hash created only out of the password or password and username? And, if it uses the password and username, in which order are they used? Hope someone could helpSmilie

---------- Post updated at 09:24 AM ---------- Previous update was at 08:16 AM ----------

Hello again,

maybe my problem is not totally clear. If I, do this

Code:
 sudo adduser ralph

and choose "hello" as the password, the entry in the /etc/shadow looks like this

Code:
ralph:$6$8UYu8b0/$GSC.6i5JA2FHt/jgR6BiGY1WQPYHBcwxy8bjT..d0gD1Q9VS6JaR7KaS7NdOkkRIZcMsXYhHcltBxj8oi5DzT/:14627:0:99999:7:::

Is it possible to reproduce this proceeding? In other words, is there a commandline-tool that allows me to create exactly the same hash?
# 2  
Old 01-18-2010
Hi Sebi0815,

Red-Hat has a nice KB about this:
Red Hat Knowledgebase: How do I verify or change the user password encryption algorithm in Red Hat Enterprise Linux?

Let us know if you need additional help.

Cheers,
Loïc.
# 3  
Old 01-19-2010
Hey Loic,

thanks for your support! Exactly what i'm looking for... Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to print hash of hash in table format

Hi, I have a hash of hash where it has name, activities and count i have data like this - $result->{$name}->{$activities} = $value; content of that are - name - robert tom cat peter activities - running, eating, sleeping , drinking, work i need to print output as below ... (3 Replies)
Discussion started by: asak
3 Replies

2. Shell Programming and Scripting

Dynamically parse BibTeX and create hash of hash

Hello gurus, Iam trying to parse following BibTex file (bibliography.bib): @book{Lee2000a, abstract = {Abstract goes here}, author = {Lee, Wenke and Stolfo, Salvatore J}, title = {{Data mining approaches for intrusion detection}}, year = {2000} } @article{Forrest1996, abstract =... (0 Replies)
Discussion started by: wakatana
0 Replies

3. Shell Programming and Scripting

Compare values of hashes of hash for n number of hash in perl without sorting.

Hi, I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all . my %result ( $abc => { 'data_count' => '10', 'ID' => 'ABC122', } $def => { 'data_count' => '20', 'ID' => 'defASe', ... (1 Reply)
Discussion started by: asak
1 Replies

4. UNIX for Dummies Questions & Answers

How to convert MD5 hash into shadow format?

I am trying to use John the Ripper but it doesn't take regular MD5 hashes, only shadow MD5 hashes. For example this hash: 900150983cd24fb0d6963f7d28e17f72 (which, decrypted, is 'abc') within a text file, John the Ripper does not detect because it is not in shadow format. How can I convert this MD5... (2 Replies)
Discussion started by: guitarscn
2 Replies

5. Shell Programming and Scripting

perl hash - using a range as a hash key.

Hi, In Perl, is it possible to use a range of numbers with '..' as a key in a hash? Something in like: %hash = ( '768..1536' => '1G', '1537..2560' => '2G' ); That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Discussion started by: dsw
3 Replies

6. Shell Programming and Scripting

Perl Hash:Can not keep hash data in the same order that it was inserted

Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below. #!/usr/bin/perl use warnings; use Tie::IxHash; use strict; tie (my %programs, "Tie::IxHash"); while (my $line = <DATA>) { chomp $line; my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies

7. Shell Programming and Scripting

Assigning a hash to another hash key

Hello, I have a hash in hsh. I need to assign it to another hash globalHsh. I think the below statement does not work $globalHsh{$id} = %hsh; What is the right way to assign it? Thanks (3 Replies)
Discussion started by: rsanjay
3 Replies

8. Solaris

hash password in shadow show 'x' ???

Hello, I want to know the reason behing the scene why some systems have hashed password in /etc/shadow file as "x" not the alienoid language like A1Dksxi3kaA.. (13 characters) As far as I understand, etc/password will show password as "x" and move all hashed password to etc/shadow.... (8 Replies)
Discussion started by: Smith
8 Replies

9. Shell Programming and Scripting

Print Entire hash list (hash of hashes)

I have a script with dynamic hash of hashes , and I want to print the entire hash (with all other hashes). Itried to do it recursively by checking if the current key is a hash and if yes call the current function again with refference to the sub hash. Most of the printing seems to be OK but in... (1 Reply)
Discussion started by: Alalush
1 Replies

10. UNIX for Dummies Questions & Answers

etc/shadow without hash

Hi, I am new to shell programming and trying to write a command that would show the etc/shadow file but without the hashes. So, something like this: root: <HASH PASSWORD FOUND BUT OBFUSCATED> daemon: NP bin: NP sys: NP If there is a... (2 Replies)
Discussion started by: hellomms
2 Replies
Login or Register to Ask a Question