• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Urban Penguin

The Urban Penguin - Linux Training

  • Home
  • About
  • Programming
    • Master Editing Text Files Using VIM
    • Learn Shell Scripting with BASH
    • PERL Scripting in Linux
    • Ruby Scripting in Linux
    • Scripting with PowerShell
    • Learn C Programming using Linux and the Raspberry Pi
    • General Java Tutorials
    • Java 7 OCA Exam 1ZO-803
  • OS Tutorials
    • Red Hat and CentOS Training
      • Red Hat Enterprise Linux System Administration 1 – RH124
      • RHCSA – System Admin 2 – RH134
      • RHCE – EX294 – Automation With Ansible
    • Learning Ubuntu
    • LPI Training
      • LPI Linux Essentials
      • LPIC-1 Linux Administrator
      • LPIC-2 Certified Linux Engineer
      • LPIC-3 Senior Level Certification
        • LPIC-3 Exam 300 : Mixed Environments
        • LPIC-3 Exam 303 : Security
        • LPIC-3 Exam 304 : Virtualization and High Availability
    • Linux Technologies
      • Apache HTTPD Server
      • Learning PHP
      • Learning PUPPET
      • Learning SAMBA
      • Linux File-Systems
      • Monitoring with Nagios Core
      • MYSQL
      • openLDAP Directories on Linux
You are here: Home / Linux / Password Last Changed: What does 18645 Mean?

Password Last Changed: What does 18645 Mean?

October 13, 2021 by The Urban Penguin

password last changed date

The password last changed date in Linux can be gained from the /etc/shadow file in Linux. You will need to be root as this is a restricted file. The field you want to look at is field 3. The field list is shown below:

  1. User
  2. Password
  3. Last change
  4. Min password age
  5. Max password age
  6. Password warning days
  7. Password inactivity lock
  8. Account expiry

Looking at my account it is 182625. If this is the when the password was changed, then what does it mean?

$ sudo getent shadow vagrant
vagrant:$6$dfMH5jB9NKW6iv1Y$FRWG5J5KC29deKUbAx3tVbh5RMDpT30eJrBQVmQ/syTkRHwHaUqsL.cDT09p6QzhsE6HtSPwlMnpy1Y5BoNS20:18625:0:99999:7:::

The date is expressed as the number of days after Jan 01 1970 that the password was changed. Oh, well that is useful!! Not. Don’t get too stressed, we can see the password last changed date by using the chage command. I am logged in as vagrant so I don’t need to use sudo with the command. If you need to check the data for another account you will need to use the command sudo.

$ sudo getent shadow vagrant
vagrant:$6$dfMH5jB9NKW6iv1Y$FRWG5J5KC29deKUbAx3tVbh5RMDpT30eJrBQVmQ/syTkRHwHaUqsL.cDT09p6QzhsE6HtSPwlMnpy1Y5BoNS20:18625:0:99999:7:::
[vagrant@rhel8 ~]$ chage -l vagrant
Last password change : Dec 29, 2020
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7

OK, but can I calculate the password last changed  date myself? Well, yes, how good are you at counting? No really it is easy. The command date in Linux is flexible, we can use it to display the current date as well as offsets to it. We can also specify a date with the offset. So if we specify the date of January 1st 1970 and add days to it will will see the password last changed date we so look for.

$ date +%F --date 'Jan 01 1970'
1970-01-01
$ date +%F --date 'Jan 01 1970 18625 days'
2020-12-29

We first prove that we can print the date for 01 Jan 1970 and then add 18625 days to it. I said that was easy and I was not lying was I. The main thing is to get practice on your own systems and you will so learn Linux the way you want to, Linux is really powerful and by knowing the right commands and their options we can do most things quite easily.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to print (Opens in new window)

Filed Under: Linux

Primary Sidebar

Newest Video

The Urban Penguin On Youtube

Categories

Pages

  • About The Urban Penguin
  • Contact Us
  • Linux Technologies
    • Apache HTTPD Server
    • Learning PHP
    • Learning PUPPET
    • Learning SAMBA
    • Linux File-Systems
    • Monitoring with Nagios Core
    • MYSQL
    • openLDAP Directories on Linux
  • LPI Training from The Urban Penguin
    • Complete Linux Essentials
    • Live and Pluralsight hosted courses
    • LPI Linux Essentials
    • LPI Linux Essentials for Raspberry Pi
    • LPIC-1 Linux Administrator
    • LPIC-2 Certified Linux Engineer
    • LPIC-3 Senior Level Certification
      • LPIC-3 Exam 300 : Mixed Environments
      • LPIC-3 Exam 303 : Security
      • LPIC-3 Exam 304 : Virtualization and High Availability
  • Online Instructor-led Courses
    • Bash Scripting Masterclass
    • Nftables Masterclass
    • Red Hat Enterprise Linux System Administration 1 – RH124
    • SELinux Masterclass
  • OpenStack
    • Citrix Videos
    • Pluralsight
    • Raspberry Pi Tutorials
    • Udemy
  • Operating System Tutorials
    • Learning SUSE
    • Learning Ubuntu
    • Linux Foundation Training
    • Red Hat and CentOS Training
      • RHCE – EX294 – Automation With Ansible
      • RHCSA – System Admin 1 – RH124
      • RHCSA – System Admin 2 – RH134
    • Solaris 11 OCA 1ZO-821
  • Scripting – the power of repetition!
    • General Java Tutorials
    • Java 7 OCA Exam 1ZO-803
    • Learn C Programming using Linux and the Raspberry Pi
    • Learn Shell Scripting with BASH
    • Master Editing Text Files Using VIM
    • PERL Scripting in Linux
    • Ruby Scripting in Linux
    • Scripting with PowerShell

© 2022 The Urban Penguin · All Rights Reserved