HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Command to set "date password last changed" of an ...
Operating System - HP-UX
1833162
Members
3629
Online
110051
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 06:58 AM
07-29-2009 06:58 AM
Command to set "date password last changed" of an user? (password aging enabled)
Hi,
I searched the manpage of passwd and the web if there is a command to edit the “date password last changed” of an user in /etc/passwd (HP-UX 11.23, non trusted). When I change the password by "passwd user" I can see the date last changed for example by “passwd –s user”. I am also able to edit this date manually in /etc/passwd (last two characters in pw column).
But is there also a command to edit that "date password last changed"?
I’d like to do that for some training users automated in a script from time to time (like the password was changed 12 weeks ago). If there is no command, what’s the correct way to edit /etc/passwd?
cp /etc/passwd /etc/ptmp
sed ‘s/^user:\([^,]*\),[^:]*:/user:\1,o.zT:/" /etc/passwd > /etc/ptmp
mv /etc/ptmp /etc/passwd
Is that the correct procedure?
I think the advantage of a command would be the automated check & lock of the passwd file.
Thanks for all your hints.
I searched the manpage of passwd and the web if there is a command to edit the “date password last changed” of an user in /etc/passwd (HP-UX 11.23, non trusted). When I change the password by "passwd user" I can see the date last changed for example by “passwd –s user”. I am also able to edit this date manually in /etc/passwd (last two characters in pw column).
But is there also a command to edit that "date password last changed"?
I’d like to do that for some training users automated in a script from time to time (like the password was changed 12 weeks ago). If there is no command, what’s the correct way to edit /etc/passwd?
cp /etc/passwd /etc/ptmp
sed ‘s/^user:\([^,]*\),[^:]*:/user:\1,o.zT:/" /etc/passwd > /etc/ptmp
mv /etc/ptmp /etc/passwd
Is that the correct procedure?
I think the advantage of a command would be the automated check & lock of the passwd file.
Thanks for all your hints.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 07:23 AM
07-29-2009 07:23 AM
Re: Command to set "date password last changed" of an user? (password aging enabled)
Shalom,
Take a backup of /etc/passwd before you try this.
passwd -x username
Will set your users up to expire somewhat more safely.
SEP
Take a backup of /etc/passwd before you try this.
passwd -x
Will set your users up to expire somewhat more safely.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2009 01:09 PM
07-29-2009 01:09 PM
Re: Command to set "date password last changed" of an user? (password aging enabled)
>I think the advantage of a command would be the automated check & lock of the passwd file.
Yes. The command is vipw(1m).
But you are own your own to figure out the password expiration encoding.
I have a program to display them, not to create them.
Yes. The command is vipw(1m).
But you are own your own to figure out the password expiration encoding.
I have a program to display them, not to create them.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP