3rd field in /etc/shadow


 
Thread Tools Search this Thread
Operating Systems Solaris 3rd field in /etc/shadow
# 1  
Old 04-30-2015
3rd field in /etc/shadow

Searched and searched, but could not find a official answer.

In Solaris, on a new server build, all the system accounts look like this:

# cat /etc/shadow
Code:
root:#########:6445::::::
daemon:NP:6445::::::
bin:NP:6445::::::
sys:NP:6445::::::
adm:NP:6445::::::
lp:NP:6445::::::
uucp:NP:6445::::::
nuucp:NP:6445::::::
smmsp:NP:6445::::::
listen:*LK*:::::::
gdm:*LK*:::::::
webservd:*LK*:::::::
postgres:NP:::::::
svctag:*LK*:6445::::::
unknown:*LK*:::::::
nobody:*LK*:6445::::::
noaccess:*LK*:6445::::::
nobody4:*LK*:6445::::::


There are a lot of system created accounts and the one ROOT account. The password HAS to be set on building, therefore updating the ROOT shadow file. But it has the same update date as the untouched accounts.

I changed the password and it did change (6445 -> 16555), but what does the original number mean?

Code:
# grep root /etc/shadow
root:AAAAAAAA:6445::::::
# passwd root
New Password:
Re-enter new Password:
passwd: password successfully changed for root
# grep root /etc/shadow
root:BBBBBBB:16555::::::


Last edited by Scrutinizer; 04-30-2015 at 11:07 AM..
# 2  
Old 04-30-2015
From man shadow, Solaris 10:
Code:
Each entry in the shadow file has the form:

     username:password:lastchg:min:max:warn:inactive:expire:flag
[..]
     lastchg         The number of days between January 1,  1970,
                     and  the  date  that  the  password was last
                     modified. The lastchg  value  is  a  decimal
                     number, as interpreted by atol(3C).

Solaris 11:
Code:
     lastchg     The number of days between January 1, 1970,  and
                 the  date  that  the password was last modified.
                 The lastchg value is a decimal number, as inter-
                 preted by strtol(3C).

# 3  
Old 04-30-2015
Yes, that is the official definition, but if I built that server TODAY, it would say the same number.

I checked my Linux servers and it is correct - that number reflects the date the server was built and the root password "changed".

If I build a Solaris server TODAY and set the ROOT password during the build, it would say "6445"

Thanks you very much for replying.
# 4  
Old 04-30-2015
So it the passwords for these accounts have not been changed since August 25, 1987 (Some version of Solaris in the lab?). I don't know why this is also the case for the root account if it is set during the install.

Last edited by Scrutinizer; 04-30-2015 at 11:50 AM..
# 5  
Old 04-30-2015
Someone had this question before: Password last changed
It's probably just a date some dev thought was significant and looked better than 0. SVR4?
# 6  
Old 04-30-2015
Thank you very much. I guess I didn't search enough on all possibilities of the issue.
Smilie Smilie
# 7  
Old 04-30-2015
Yes, August 25, 1987, is probably the date when the SVR4.0 beta source code branch was first created. SVR4.0 was officially announced in October 18, 1988
This User Gave Thanks to jlliagre For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to add subtotal and total according 3rd field mentioned below table?

111AKKK|SHA|20|25 111|AKKK|SHA|15|35 112|ABC|FL|25|45 112|ABC|FL|15|15 115|AKKK|ASH|10|15 115|AKKK|ASH|20|20 112|ABC|FL|25|20 115|AKKK|ASH|30|35 111|AKKK|SHA|10|45 112|ABC|KL|15|15 112|ABC|KL|20|25 115|AKKK|ASH|30|35 please write a shell script output should be below mentioned... (26 Replies)
Discussion started by: udhal
26 Replies

2. Solaris

Passwd -l or -u modifies lastchg field in /etc/shadow file

Hi, I have a Solaris 10 box where password aging is not functioning properly. Using the passwd command with the -l or -u options causes the lastchg field in the /etc/shadow file to be modified. Therefore, if a user's password is set to expire in 90 days and they are 1 day away, all they have... (4 Replies)
Discussion started by: cschar
4 Replies

3. Shell Programming and Scripting

Perl - use search keywords from array and search a file and print 3rd field when matched

Hi , I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code. my $current_value=12345; my @users=("bob","ben","tom","harry"); open DBLIST,"<","/var/tmp/DBinfo"; my @input = <DBLIST>; foreach (@users) { my... (11 Replies)
Discussion started by: chidori
11 Replies

4. Shell Programming and Scripting

awk to compare 2nd and 3rd field and print the differences

need a one liner to compare 2nd and 3rd field and print values that are not matched in 2nd field Input col 2 col 3 1.1.1.1 11.11.11.11 8.8.8.8 0.0.0.0 3.3.3.3 2.2.2.2 7.7.7.7 3.3.3.3 5.5.5.5 1.1.1.1 4.4.4.4 6.6.6.6 9.9.9.9 output 7.7.7.7 ... (12 Replies)
Discussion started by: chidori
12 Replies

5. Solaris

9th field in shadow file

Hi experts, Can somebody explain, what is 9th field in /etc/shadow ? The last digit - (5 Replies)
Discussion started by: solaris_1977
5 Replies

6. Shell Programming and Scripting

only print line if 3rd field is 01

Similar question... I have a space delimited text file and I want to only print the lines where the 3rd word/field/column is equal to "01" awk '{if $3 = "01" print $0}' something like this. I meant to say: only print line IF 3rd field is 01 (2 Replies)
Discussion started by: ajp7701
2 Replies

7. Shell Programming and Scripting

replace 3rd field of space delimited text file

how to replace the 3rd colum? Each line begins similarly, but they all ends variously. XX YY 03 variable text here XX YY 03 more variable text here XX YY 03 even more variable text here really long setence XX YY 03 variable numbers also appear 03 11. 123 456 XX YY 03 the occasional comma,... (4 Replies)
Discussion started by: ajp7701
4 Replies

8. Shell Programming and Scripting

print the last line of an recurring pattern on the 3rd field

How can i awk/sed to print the last line of an recurring pattern on the 3rd field? Input lines: 123456.1 12 1357911 11111.1 01 123456.2 12 1357911 11111.2 02 123456.3 12 1357911 11111.3 03 123456.4 12 1357911 11111.4 04 123456.5 12 1357911 11111.5 05 246810.1 12 1357911 22222.1 01... (4 Replies)
Discussion started by: ux4me
4 Replies

9. Shell Programming and Scripting

Deleting every 3rd field using awk

I have a file whose format is like the following 350,2,16.2,195,2,8.0 every 3rd column of this file should be deleted. How can i achieve this tried with the following iostat -D -l 2 | /usr/xpg4/bin/awk ' NR>2 { for (i=0;i<=NF;i++)if(i%3==0)$i=""};' but no luck (3 Replies)
Discussion started by: achak01
3 Replies

10. Shell Programming and Scripting

Extract Part of string from 3rd field $3 using AWK

I'm executing "wc -lc" command in a c shell script to get record count and byte counts and writing them to a file. I get the result with the full pathname of the file. But I do not want the path name to be printed in the output file. I heard that using Awk we can get this but I don't have any... (4 Replies)
Discussion started by: stakuri
4 Replies
Login or Register to Ask a Question