- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Disable password aging.
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
05-08-2003 08:29 AM
05-08-2003 08:29 AM
Disable password aging.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 08:51 AM
05-08-2003 08:51 AM
Re: Disable password aging.
passwd -x
where max is the number of days before it is expired. Set to the largest value allowed; 441
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 08:55 AM
05-08-2003 08:55 AM
Re: Disable password aging.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 08:58 AM
05-08-2003 08:58 AM
Re: Disable password aging.
# vipw
..to edit the password file.
Example ..
skchan:djfghsDipBwQA,O28P: ..
would become
skchan:djfghsDipBwQA: ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 09:27 AM
05-08-2003 09:27 AM
Re: Disable password aging.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 09:50 AM
05-08-2003 09:50 AM
Re: Disable password aging.
#passwd -n 0 -x 0 username This can be done on a non-trusted system
-USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 09:52 AM
05-08-2003 09:52 AM
Re: Disable password aging.
The above method force user to change his password during next login.
If this is not OK then use the method given Chan by editing /etc/passwd file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 10:24 AM
05-08-2003 10:24 AM
Re: Disable password aging.
#! /usr/bin/ksh
cat /etc/passwd |
while read line
do
echo $line | sed 's/,?*:/:/g' >> passwd.new
done
#end of script
now after you have finished this you could just copy the passwd.new into /etc/passwd
NOTE: you may wish to backup the /etc/passwd file prior to overwritting it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 10:26 AM
05-08-2003 10:26 AM
Re: Disable password aging.
#!/usr/bin/sh
TDIR=${TMPDIR:-/var/tmp}
PID=${$}
A1=${TDIR}/A${PID}_1.awk
INFILE=/etc/passwd
cat << !EOF! > ${A1}
{
n = split(\$0,aray,":")
if (n >= 2)
{
n2 = split(aray[2],bray,",");
if (n2 > 1) aray[2] = bray[1]
i = 1
while (i < n)
{
printf("%s:",aray[i])
++i
}
printf("%s\n",aray[i])
}
else printf("%s\n",\$0)
}
!EOF!
awk -f ${A1} < ${INFILE}
STAT=${?}
rm -f ${A1}
exit ${STAT}
----------------------------
It will read /etc/passwd and write the updated version on stdout. You can them copy the updated version to /etc/passwd. If you are running NIS, then change the input from awk < ${INFILE} to ypcat passwd | awk.
Anytime you do something like this, I suggest that 1) you make a backup copy of /etc/passwd 2) you are logged in as root in two sessions.
If you follow these rules, you can always get yourself out of trouble almost as fast as you got yourself in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 10:31 AM
05-08-2003 10:31 AM
Re: Disable password aging.
Great recommendation about having 2 login sessions.... that way if the one craps out and /etc/passwd is broken the second window is already loged on and able to fix things
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2003 10:32 AM
05-08-2003 10:32 AM
Re: Disable password aging.
# cd /etc
# cp passwd passwd.org
# for i in `cat /tmp/fileA`
> do
> passwd -x 0 $i
> done
Afetrwards you should see that the first char after the comma should be set to ".", example ..
Before
skchan:XXX,022P:
After
skchan:XXX,.2AP:
Ignore the last 2 chars (ie A and P) because that denotes when the password is last changed. The first 2 chars ( ie . and 2) means represent..
. = 0 weeks (max num of weeks the password is valid)
2 = 4 weeks (min num of weeks that has to pass before the password can be changed). After this change the password should not expire, the first char will remain as "." even though the user change his/her password. Test it first .. I hope I'm not wrong.