Saturday, 11 June 2011

Change passwords and adjust password aging for local user accounts

For this objective you will need to familiarize yourself with the passwd command.

Change passwords for local user accounts:
passwd username
As with most commands there are plenty of options, but the above command will prompt you to enter a new password for the account username.

Adjust password aging for local user accounts:

The passwd command  can be used to achieve this objective. Say, you want a user password to expire in 30 days:
passwd -x 30 username
This can, sort of, also be achieved, with chage:
chage -E 'Jul 11, 2011' username
This command will actually disable the account in 30 days, so perhaps it is not quite what the objective calls for, but interesting to know nonetheless.

The following command will let you see the account status:
passwd -S username
You can also get relevant information regarding account aging with:
chage -l username

No comments:

Post a Comment