Questions tagged [shadow]

99 questions
165
votes
10 answers

Manually generate password for /etc/shadow

I need to manually edit /etc/shadow to change the root password inside of a virtual machine image. Is there a command-line tool that takes a password and generates an /etc/shadow compatible password hash on standard out?
Lorin Hochstein
  • 8,077
  • 17
  • 50
  • 56
86
votes
3 answers

What is the 6th character of the password hash on Linux, and why is it often a slash?

On Linux, what is the sixth character of the password hash stored in /etc/shadow? On my puppy style linux box, if I try to generate 100 random passwords using shuf and /dev/urandom, then the sixth character is / about half the time. My question is…
insecure
  • 761
  • 5
  • 5
63
votes
2 answers

Difference between ! vs !! vs * in /etc/shadow

The second field in the Linux /etc/shadow file represents a password. However, what we have seen is that: Some of the password fields may have a single exclamation :!:..... Some of the password fields may have a double exclamation…
JavaTec
  • 797
  • 2
  • 8
  • 11
37
votes
3 answers

When did Unix stop storing passwords in clear text?

When did Unix move away from storing clear text passwords in passwd? Also, when was the shadow file introduced?
ZDOSA
  • 487
  • 4
  • 5
35
votes
2 answers

/etc/shadow : how to generate $6$ 's encrypted password?

In /etc/shadow file there are encrypted password. Encrypted password is no longer crypt(3) or md5 "type 1" format. (according to this previous answer) Now I have a $6$somesalt$someveryverylongencryptedpasswd as entry. I can no longer use openssl…
Archemar
  • 31,183
  • 18
  • 69
  • 104
13
votes
2 answers

Disable password on linux user with command

Based on /etc/shadow(5) documentation on the second (password) field: encrypted password If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log…
trikelef
  • 381
  • 1
  • 4
  • 13
10
votes
1 answer

The format of encrypted password in `/etc/shadow`

I see a hashed passphrase like the following in /etc/shadow. I don't quite understand its format. $y$j9T$F5Jx5fExrKuPp53xLKQ..1$X3DX6M94c7o.9agCG9G317fhZg9SqC.5i5rd.RhAtQ7 It is made of four parts as shown below. According to crypt(5), y means…
user15502206
  • 209
  • 1
  • 2
  • 3
8
votes
1 answer

why have programs like su access to /etc/shadow

Normally only root can access /etc/shadow. But programs like su and sudo can check passwords without running as root. So the question is: Why can these programs access /etc/shadow without privileges? I tried to access it without privileges via…
Kritzefitz
  • 673
  • 3
  • 12
  • 22
8
votes
4 answers

What's the meaning of NP and UP in the password field of the shadow file

I found some entries in a shadow file whose meaning I don't understand. user:UP::::::: user1:NP::::::: What does UP and NP mean? In addition to those 2, the same shadow file has the normal hashed entry and the LK that indicates a locked account.…
Ayrx
  • 469
  • 3
  • 9
  • 16
8
votes
1 answer

Is it normal to have a file called "shadow-" in the /etc directory?

I am noticing a lot of weird files appearing in my router and on my various filesystems. Files in weird places or files that have to do with security with a - sign after them. If I do ls -l /etc/shadow*, this is what I see. -rw-r----- 1 root shadow…
PROXY NINJA
  • 477
  • 2
  • 4
  • 9
8
votes
2 answers

SHA512 salted hash from mkpasswd doesn't match an online version

I'm puzzled by the hash (ASCII) code stored under Linux (Ubuntu) /etc/shadow. Taking a hypothetical case, let password be 'test', salt be 'Zem197T4'. By running following command, $ mkpasswd -m SHA-512 test Zem197T4 A long series of ASCII…
A. Au
  • 83
  • 1
  • 4
8
votes
2 answers

Is it possible to change passwords temporarily?

I have a Linux system with several users. I don't know their passwords, nor do I want to know them. I have to do a batch copy of some of their directories over SSH, with their account and password. My idea was to make a backup of /etc/shadow, then…
user79264
  • 81
  • 1
  • 2
8
votes
3 answers

Root and my password are the same

If I cat /etc/shadow I can get the encrypted passwords of root and my user. These passwords are the same (I know, bad security) for each account, but in /etc/shadow they show up as being different encrypted strings. Why? Are different algorithms…
user75027
  • 613
  • 2
  • 8
  • 12
7
votes
1 answer

How to know if password in /etc/shadow is hashed with SHA or MD?

I want to know my /etc/shadow password hash if its SHA or MD or something else. From what I read, it is related to the $ sign, but I don't have any dollar signs. Im using Ubuntu 16 Example: user:0.7QYSH8yshtus8d:18233:0:99999:7:::
Batchen Regev
  • 181
  • 1
  • 1
  • 4
7
votes
2 answers

/etc/shadow and /etc/passwd format compatibility

Are formats of files /etc/shadow and /etc/passwd same on all unix and unix-like systems same or are there significant differences? I mean syntax of files, not file location or name
rkosegi
  • 603
  • 7
  • 15
1
2 3 4 5 6 7