Commit | Line | Data |
---|---|---|
3cadd34f KB |
1 | .\" Copyright (c) 1988, 1990, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
0568f98e | 3 | .\" |
b5dc1377 | 4 | .\" %sccs.include.redist.man% |
0568f98e | 5 | .\" |
3cadd34f | 6 | .\" @(#)chpass.1 8.1 (Berkeley) %G% |
0568f98e | 7 | .\" |
b5dc1377 CL |
8 | .Dd |
9 | .Dt CHPASS 1 | |
0e853b88 | 10 | .Os |
b5dc1377 CL |
11 | .Sh NAME |
12 | .Nm chpass | |
13 | .Nd add or change user database information | |
14 | .Sh SYNOPSIS | |
15 | chpass | |
16 | .Op Fl a Ar list | |
8e7982f9 | 17 | .Op Fl s Ar newshell |
b5dc1377 CL |
18 | .Op user |
19 | .Sh DESCRIPTION | |
20 | .Nm Chpass | |
0568f98e KB |
21 | allows editing of the user database information associated |
22 | with | |
b5dc1377 | 23 | .Ar user |
0568f98e KB |
24 | or, by default, the current user. |
25 | The information is formatted and supplied to an editor for changes. | |
b5dc1377 | 26 | .Pp |
0568f98e | 27 | Only the information that the user is allowed to change is displayed. |
b5dc1377 CL |
28 | .Pp |
29 | The options are as follows: | |
0e853b88 CL |
30 | .Bl -tag -width Ds |
31 | .It Fl a | |
b5dc1377 CL |
32 | The super-user is allowed to directly supply a user database |
33 | entry, in the format specified by | |
34 | .Xr passwd 5 , | |
35 | as an argument. | |
36 | This argument must be a colon (``:'') separated list of all the | |
37 | user database fields, although they may be empty. | |
0e853b88 | 38 | .It Fl s |
b5dc1377 CL |
39 | The |
40 | .Fl s | |
41 | option attempts to change the user's shell to | |
8e7982f9 | 42 | .Ar newshell . |
0e853b88 | 43 | .El |
b5dc1377 | 44 | .Pp |
74086f3a | 45 | Possible display items are as follows: |
b5dc1377 | 46 | .Pp |
0e853b88 CL |
47 | .Bl -tag -width "Home Directory:" -compact -offset indent |
48 | .It Login: | |
b5dc1377 | 49 | user's login name |
0e853b88 | 50 | .It Password: |
b5dc1377 | 51 | user's encrypted password |
0e853b88 | 52 | .It Uid: |
8e7982f9 | 53 | user's login |
0e853b88 | 54 | .It Gid: |
8e7982f9 | 55 | user's login group |
0e853b88 | 56 | .It Change: |
b5dc1377 | 57 | password change time |
0e853b88 | 58 | .It Expire: |
b5dc1377 | 59 | account expiration time |
0e853b88 | 60 | .It Class: |
b5dc1377 | 61 | user's general classification |
0e853b88 | 62 | .It Home Directory: |
b5dc1377 | 63 | user's home directory |
0e853b88 | 64 | .It Shell: |
b5dc1377 | 65 | user's login shell |
0e853b88 | 66 | .It Full Name: |
b5dc1377 | 67 | user's real name |
0e853b88 | 68 | .It Location: |
b5dc1377 | 69 | user's normal location |
0e853b88 | 70 | .It Home Phone: |
b5dc1377 | 71 | user's home phone |
0e853b88 | 72 | .It Office Phone: |
b5dc1377 | 73 | user's office phone |
0e853b88 | 74 | .El |
b5dc1377 | 75 | .Pp |
74086f3a | 76 | The |
b5dc1377 | 77 | .Ar login |
b7eb8299 | 78 | field is the user name used to access the computer account. |
b5dc1377 | 79 | .Pp |
b7eb8299 | 80 | The |
b5dc1377 | 81 | .Ar password |
b7eb8299 | 82 | field contains the encrypted form of the user's password. |
b5dc1377 | 83 | .Pp |
b7eb8299 | 84 | The |
b5dc1377 | 85 | .Ar uid |
b7eb8299 | 86 | field is the number associated with the |
b5dc1377 | 87 | .Ar login |
b7eb8299 KB |
88 | field. |
89 | Both of these fields should be unique across the system (and often | |
90 | across a group of systems) as they control file access. | |
b5dc1377 | 91 | .Pp |
74086f3a KB |
92 | While it is possible to have multiple entries with identical login names |
93 | and/or identical user id's, it is usually a mistake to do so. Routines | |
94 | that manipulate these files will often return only one of the multiple | |
95 | entries, and that one by random selection. | |
b5dc1377 | 96 | .Pp |
74086f3a | 97 | The |
b5dc1377 | 98 | .Ar group |
34dda72c | 99 | field is the group that the user will be placed in at login. |
8e7982f9 | 100 | Since BSD supports multiple groups (see |
b5dc1377 | 101 | .Xr groups 1 ) |
74086f3a KB |
102 | this field currently has little special meaning. |
103 | This field may be filled in with either a number or a group name (see | |
b5dc1377 CL |
104 | .Xr group 5 ) . |
105 | .Pp | |
74086f3a | 106 | The |
b5dc1377 | 107 | .Ar change |
7f554f7b | 108 | field is the date by which the password must be changed. |
b5dc1377 | 109 | .Pp |
74086f3a | 110 | The |
b5dc1377 | 111 | .Ar expire |
7f554f7b | 112 | field is the date on which the account expires. |
b5dc1377 | 113 | .Pp |
74086f3a | 114 | Both the |
b5dc1377 | 115 | .Ar change |
74086f3a | 116 | and |
b5dc1377 | 117 | .Ar expire |
ef97d022 | 118 | fields should be entered in the form ``month day year'' where |
b5dc1377 | 119 | .Ar month |
7f554f7b | 120 | is the month name (the first three characters are sufficient), |
b5dc1377 | 121 | .Ar day |
d264b2a3 | 122 | is the day of the month, and |
b5dc1377 | 123 | .Ar year |
7f554f7b | 124 | is the year. |
0e853b88 | 125 | .Pp |
74086f3a | 126 | The |
b5dc1377 | 127 | .Ar class |
74086f3a KB |
128 | field is currently unused. In the near future it will be a key to |
129 | a | |
b5dc1377 | 130 | .Xr termcap 5 |
74086f3a | 131 | style database of user attributes. |
b5dc1377 | 132 | .Pp |
5325ced3 CL |
133 | The user's |
134 | .Ar home directory | |
135 | is the full UNIX path name where the user | |
34dda72c | 136 | will be placed at login. |
b5dc1377 | 137 | .Pp |
5325ced3 CL |
138 | The |
139 | .Ar shell | |
140 | field is the command interpreter the user prefers. | |
74086f3a | 141 | If the |
b5dc1377 CL |
142 | .Ar shell |
143 | field is empty, the Bourne shell, | |
144 | .Pa /bin/sh , | |
145 | is assumed. | |
34dda72c KB |
146 | When altering a login shell, and not the super-user, the user |
147 | may not change from a non-standard shell or to a non-standard | |
148 | shell. | |
149 | Non-standard is defined as a shell not found in | |
b5dc1377 CL |
150 | .Pa /etc/shells . |
151 | .Pp | |
5325ced3 CL |
152 | The last four fields are for storing the user's |
153 | .Ar full name , office location , | |
154 | and | |
155 | .Ar home | |
156 | and | |
157 | .Ar work telephone | |
158 | numbers. | |
b5dc1377 | 159 | .Pp |
0568f98e | 160 | Once the information has been verified, |
b5dc1377 | 161 | .Nm chpass |
0568f98e | 162 | uses |
bc3d7b01 KB |
163 | .Xr pwd_mkdb 8 |
164 | to update the user database. | |
b5dc1377 CL |
165 | .Sh ENVIRONMENT |
166 | The | |
167 | .Xr vi 1 | |
168 | editor will be used unless the environment variable EDITOR is set to | |
169 | an alternate editor. | |
170 | When the editor terminates, the information is re-read and used to | |
171 | update the user database itself. | |
172 | Only the user, or the super-user, may edit the information associated | |
173 | with the user. | |
174 | .Sh FILES | |
0e853b88 CL |
175 | .Bl -tag -width /etc/master.passwd -compact |
176 | .It Pa /etc/master.passwd | |
b5dc1377 | 177 | The user database |
0e853b88 | 178 | .It Pa /etc/passwd |
bc3d7b01 | 179 | A Version 7 format password file |
0e853b88 | 180 | .It Pa /etc/chpass.XXXXXX |
bc3d7b01 | 181 | Temporary copy of the password file |
0e853b88 | 182 | .It Pa /etc/shells |
b5dc1377 | 183 | The list of approved shells |
0e853b88 | 184 | .El |
b5dc1377 CL |
185 | .Sh SEE ALSO |
186 | .Xr login 1 , | |
187 | .Xr finger 1 , | |
bc3d7b01 | 188 | .Xr passwd 1 , |
b5dc1377 CL |
189 | .Xr getusershell 3 , |
190 | .Xr passwd 5 , | |
bc3d7b01 | 191 | .Xr pwd_mkdb 8 , |
b5dc1377 | 192 | .Xr vipw 8 |
0e853b88 CL |
193 | .Rs |
194 | .%A Robert Morris | |
195 | .%A Ken Thompson | |
196 | .%T "UNIX Password security" | |
197 | .Re | |
b5dc1377 | 198 | .Sh BUGS |
74086f3a | 199 | User information should (and eventually will) be stored elsewhere. |
0e853b88 CL |
200 | .Sh HISTORY |
201 | The | |
202 | .Nm | |
203 | command appeared in | |
204 | .Bx 4.3 Reno . |