Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page



 

Linux / Unix passwd command

Quick links

About passwd
Syntax
Examples
Related commands
Linux / Unix main page

About passwd

Allows you to change your password.

Syntax

passwd [-r | files | -r nis | -r nisplus ] [-a] [-d | -l] [-e] [-f] [-g] [-h] [-n min] [-s] [-w warn] [-x max] [-D domainname][ name ]

-r Specifies the repository to which an operation is applied. The supported repositories are files, nis or nisplus.
-a Show password attributes for all entries. Use only with the -s option; name must not be provided. For the nisplus repository, this will show only the entries in the NIS+ password table in the local domain that the invoker is authorized to "read". For the files repository, this is restricted to the superuser.
-d Deletes password for name. The login name will not be prompted for password. It is only applicable to the files repository.
-l Locks password entry for name.
-e Change the login shell. For the files repository, this only works for the super-user. Normal users may change the nis or nisplus repositories. The choice of shell is limited by the requirements of getusershell(3C). If the user currently has a shell that is not allowed by getusershell , only root may change it.
-f Force the user to change password at the next login by expiring the password for name.
-g Change the gecos (finger) information. For the files repository, this only works for the superuser. Normal users may change the nis or nisplus repositories.
-h Change the home directory.
-n min Set minimum field for name. The min field contains the minimum number of days between password changes for name. If min is greater than max, the user may not change the password. Always use this option with the -x option, unless max is set to -1 (aging turned off). In that case, min need not be set.
-s Displays information including your username and if you do/don't have a password (This command will not actually show the password.)

Below is the format the password information for the login id will be displayed:

name status mm/dd/yy min max warn

name The login ID of the user.
status Status of the name:

   PS = Passworded
   LK = Locked
   NP = No Password

mm/dd/yy The month date and year that the password was last changed. This information is derived from the Greenwich Mean Time (Universal Time) and therefore may differ by as much as a day in some times zones.
min The minimum number of days between password changes.
max The maximum number of days the password is valid for the name.
warn The number of days relative to max before the passwd uses pam for password management.

 

-w warn Set warn field for name. The warn field contains the number of days before the password expires and the user is warned. This option is not valid if password aging is disabled.
-x max Set maximum field for name. The max field contains the number of days that the password is valid for name. The aging for name will be turned off immediately if max is set to -1. If it is set to 0, then the user is forced to change the password at the next login session and aging is turned off.
-D domainname Consult the passwd.org_dir table in domainname.  If this option is not specified, the default domainname returned by nis_local_directory(3N) will be used. This domain name is the same as that returned by domainname(1M).
name Login ID of user

Examples

passwd - entering just passwd would allow you to change the password. After entering passwd you will receive the following three prompts:

Current Password:
New Password:
Confirm New Password:

Each of these prompts must be entered and entered correctly for the password to be successfully changed.

passwd newperson

If you have just setup an account using the useradd command you would then type a command similar to the above command to set the password for the "newperson" account. Only root users have the ability to set passwords for other accounts.

Related commands

chfn
finger
login
nispasswd
nistbladm
useradd
vipw
yppasswd

Index

Category:
Linux / Unix

Companies:
Click here

Related Pages:
CH001105

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope