Sponsored Content
Operating Systems Linux How to generate the hash in /etc/shadow Post 302387758 by Sebi0815 on Monday 18th of January 2010 09:24:16 AM
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?
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
UUIDGEN(1)							   User Commands							UUIDGEN(1)

NAME
uuidgen - create a new UUID value SYNOPSIS
uuidgen [options] DESCRIPTION
The uuidgen program creates (and prints) a new universally unique identifier (UUID) using the libuuid(3) library. The new UUID can reason- ably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future. There are three types of UUIDs which uuidgen can generate: time-based UUIDs, random-based UUIDs, and hash-based UUIDs. By default uuidgen will generate a random-based UUID if a high-quality random number generator is present. Otherwise, it will choose a time-based UUID. It is possible to force the generation of one of these first two UUID types by using the --random or --time options. The third type of UUID is generated with the --md5 or --sha1 options, followed by --namespace namespace and --name name. The namespace may either be a well-known UUID, or else an alias to one of the well-known UUIDs defined in RFC 4122, that is @dns, @url, @oid, or @x500. The name is an arbitrary string value. The generated UUID is the digest of the concatentation of the namespace UUID and the name value, hashed with the MD5 or SHA1 algorithms. It is, therefore, a predictable value which may be useful when UUIDs are being used as handles or nonces for more complex values or values which shouldn't be disclosed directly. See the RFC for more information. OPTIONS
-r, --random Generate a random-based UUID. This method creates a UUID consisting mostly of random bits. It requires that the operating system have a high quality random number generator, such as /dev/random. -t, --time Generate a time-based UUID. This method creates a UUID based on the system clock plus the system's ethernet hardware address, if present. -h, --help Display help text and exit. -V, --version Display version information and exit. -m, --md5 Use MD5 as the hash algorithm. -s, --sha1 Use SHA1 as the hash algorith. -n, --namespace namespace Generate the hash with the namespace prefix. The namespace is UUID, or '@ns' where "ns" is well-known predefined UUID addressed by namespace name (see above). -N, --name name Generate the hash of the name. -x, --hex Interpret name name as a hexidecimal string. CONFORMING TO
OSF DCE 1.1 EXAMPLES
uuidgen --sha1 --namespace @dns --name "www.example.com" AUTHOR
uuidgen was written by Andreas Dilger for libuuid. SEE ALSO
libuuid(3), RFC 4122 AVAILABILITY
The uuidgen command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/. util-linux June 2011 UUIDGEN(1)
All times are GMT -4. The time now is 11:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy