Quote:
Originally posted by rockdw
Use xargs to take the output of the awk command. I don't know what change itself is capable of, but I assume change -l lists profile info. xargs takes the resulting wordlist and does the next command against each item one at a time:
cat /etc/passwd | awk -F: '{print $1}' | xargs change -l
|
From the man command:
NAME
chage - change user password expiry information
SYNOPSIS
chage [-m mindays] [-M maxdays] [-d lastday] [-I inactive]
[-E expiredate] [-W warndays] user
chage -l user
DESCRIPTION
chage changes the number of days between password changes and the date
of the last password change. This information is used by the system to
determine when a user must change her password. The chage command is
restricted to the root user, except for the -l option, which may be
used by an unprivileged user to determine when her password or account
is due to expire.
So who can use the command may be affecting what's going on.
Typing in
awk -F: '{print $1}' /etc/passwd
is sufficient to list ALL accounts in the passwd file, but I'm not really sure that's what you'd want to do. Many of the accounts are really interfaces to special purpose events, like shutdown, bin, daemon, and other accounts specifically intended not as login accounts, but to serve as interfaces to specific functions. In fact, on my system, there are only really two login accounts that I know of, root and masinick, yet there are
wc -l /etc/passwd
24 /etc/passwd
24 entries in the file.
So a good solution to this problem, in my estimation, would be to weed out the unnecessary accounts. Run whatever shell you develop from root, then it should work properly with chage - 'change age'... hmm, should I run chage on myself? LOL