<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Notifying Users of Mandatory Password Changes in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915862#M26404</link>
    <description>Hi there --&lt;BR /&gt;&lt;BR /&gt;I created the script according to the text that your posted in the forum. When I ran the script   a series of messages appeared indicating problems sending to the address &lt;FIRSTNAME&gt;, and then to the adderss &lt;LASTNAME&gt;. &lt;BR /&gt;&lt;BR /&gt;What changes should I make to correct this? Thanks.&lt;/LASTNAME&gt;&lt;/FIRSTNAME&gt;</description>
    <pubDate>Wed, 20 Dec 2006 15:16:18 GMT</pubDate>
    <dc:creator>Andrew Kaplan</dc:creator>
    <dc:date>2006-12-20T15:16:18Z</dc:date>
    <item>
      <title>Notifying Users of Mandatory Password Changes</title>
      <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915858#M26400</link>
      <description>Hi there --&lt;BR /&gt;&lt;BR /&gt;Is there a script that would notify users that they need to change their passwords within a given timeframe? I know chage will check individual user accounts, but can it be used to check all user accounts and have the results either e-mailed to the administrator or to the various users? Thanks.</description>
      <pubDate>Wed, 20 Dec 2006 08:31:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915858#M26400</guid>
      <dc:creator>Andrew Kaplan</dc:creator>
      <dc:date>2006-12-20T08:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying Users of Mandatory Password Changes</title>
      <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915859#M26401</link>
      <description>I have a few. Are you using local accounts or ldap accounts?</description>
      <pubDate>Wed, 20 Dec 2006 09:10:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915859#M26401</guid>
      <dc:creator>George Liu_4</dc:creator>
      <dc:date>2006-12-20T09:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying Users of Mandatory Password Changes</title>
      <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915860#M26402</link>
      <description>Hi there --&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply. The accounts in question are all local to the machine.</description>
      <pubDate>Wed, 20 Dec 2006 09:15:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915860#M26402</guid>
      <dc:creator>Andrew Kaplan</dc:creator>
      <dc:date>2006-12-20T09:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying Users of Mandatory Password Changes</title>
      <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915861#M26403</link>
      <description>#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;users=`grep -v ":\!\!:"  /etc/shadow|grep -v ":\*:" |grep -v root|cut -f1 -d:`&lt;BR /&gt;expire_time=90&lt;BR /&gt;today=$(( `perl -le 'print time'` / 86400 ))&lt;BR /&gt;&lt;BR /&gt;for user in $users ; do&lt;BR /&gt;    last_change=$(( `grep $user /etc/shadow |cut -f3 -d:` ))&lt;BR /&gt;    days_left=$(( $expire_time - $today + $last_change ))&lt;BR /&gt;    if [ $days_left -lt 15 -a $days_left -ge 0 ]; then&lt;BR /&gt;        user_mail=`grep $user /etc/passwd|cut -f5 -d: `&lt;BR /&gt;#       echo&lt;BR /&gt;#       echo  "ATTENTION: The password of $user will expire in $days_left days.\n"&lt;BR /&gt;&lt;BR /&gt;        mail -s "Your password on xxx system will expire in $days_left" $user_mail &amp;lt;&amp;lt; EOF&lt;BR /&gt;Hello,&lt;BR /&gt;    Your password of account $user, which is used for accessing xxx server on&lt;BR /&gt;    host `uname -n`, will expire in $days_left days.&lt;BR /&gt;&lt;BR /&gt;    Please update your password.&lt;BR /&gt;&lt;BR /&gt;    Thanks for your support!&lt;BR /&gt;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Dec 2006 12:34:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915861#M26403</guid>
      <dc:creator>George Liu_4</dc:creator>
      <dc:date>2006-12-20T12:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying Users of Mandatory Password Changes</title>
      <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915862#M26404</link>
      <description>Hi there --&lt;BR /&gt;&lt;BR /&gt;I created the script according to the text that your posted in the forum. When I ran the script   a series of messages appeared indicating problems sending to the address &lt;FIRSTNAME&gt;, and then to the adderss &lt;LASTNAME&gt;. &lt;BR /&gt;&lt;BR /&gt;What changes should I make to correct this? Thanks.&lt;/LASTNAME&gt;&lt;/FIRSTNAME&gt;</description>
      <pubDate>Wed, 20 Dec 2006 15:16:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915862#M26404</guid>
      <dc:creator>Andrew Kaplan</dc:creator>
      <dc:date>2006-12-20T15:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying Users of Mandatory Password Changes</title>
      <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915863#M26405</link>
      <description>&lt;!--!*#--&gt;Hi Andrew:&lt;BR /&gt;&lt;BR /&gt;The format and contents of the fifth field (one-relative) of '/etc/passwd' is left to an administrator's discretion.  George's script appears to assume that the fifth field contains a string that represents a valid email address.  Your 'passwd' database apparently does not follow this convention.&lt;BR /&gt;&lt;BR /&gt;You can simply create mail to the account on the server that you are examining with this change:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;if [ $days_left -lt 15 -a $days_left -ge 0 ]; then&lt;BR /&gt;    mail -s "Your password on xxx system will expire in $days_left" $user &amp;lt;&amp;lt; EOF&lt;BR /&gt;Hello,&lt;BR /&gt;Your password of account $user, which is used for accessing xxx server on&lt;BR /&gt;host `uname -n`, will expire in $days_left days.&lt;BR /&gt;Please update your password.&lt;BR /&gt;Thanks for your support!&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;...Note that I dropped the line:&lt;BR /&gt;&lt;BR /&gt;user_mail=`grep $user /etc/passwd|cut -f5 -d: `&lt;BR /&gt;&lt;BR /&gt;...and used ${user} in lieu of ${user_mail} for the mail account.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 20 Dec 2006 15:59:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915863#M26405</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-12-20T15:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying Users of Mandatory Password Changes</title>
      <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915864#M26406</link>
      <description>My original script is used to get mail address from different database so I leave the way as it is.</description>
      <pubDate>Wed, 20 Dec 2006 16:20:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915864#M26406</guid>
      <dc:creator>George Liu_4</dc:creator>
      <dc:date>2006-12-20T16:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Notifying Users of Mandatory Password Changes</title>
      <link>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915865#M26407</link>
      <description>"passwd -w" will start to warn users once their password comes within a certain number of days before expiry.</description>
      <pubDate>Thu, 21 Dec 2006 03:12:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/notifying-users-of-mandatory-password-changes/m-p/3915865#M26407</guid>
      <dc:creator>Andrew Cowan</dc:creator>
      <dc:date>2006-12-21T03:12:42Z</dc:date>
    </item>
  </channel>
</rss>

