home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sun / admin / 9847 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  7.6 KB

  1. Path: sparky!uunet!auspex-gw!guy
  2. From: guy@Auspex.COM (Guy Harris)
  3. Newsgroups: comp.sys.sun.admin
  4. Subject: Re: Format of aging entries in /etc/passwd
  5. Message-ID: <16181@auspex-gw.auspex.com>
  6. Date: 31 Dec 92 19:51:22 GMT
  7. References: <1hv5ebINN2af@flash.pax.tpa.com.au>
  8. Sender: news@auspex-gw.auspex.com
  9. Organization: Auspex Systems, Santa Clara
  10. Lines: 331
  11. Nntp-Posting-Host: auspex.auspex.com
  12.  
  13. >I have been playing about with password aging (SunOS 4.1.2) and would be
  14. >intersted to hear if anyone knows exactly what the format of what comes
  15. >after the ',' in the password field of the /etc/passwd file. I know that
  16. >",." implements immediate expiry, but I would like to know the rest.
  17.  
  18. Oh, damn, *another* man page that didn't get updated.  See attached
  19. version of "passwd.5", with text lifted from the SVR3 manual (I didn't
  20. check that the SunOS implementation does everything exactly the same way
  21. the SVR3 implementation does, although at least some of the code is
  22. lifted directly from SVR3):
  23.  
  24. >I presume this is all different in Solaris 2 !
  25.  
  26. Yeah, AT&T stuck the aging stuff into "/etc/shadow" in SVR4.  See
  27. "shadow(4)".
  28.  
  29. Updated "passwd.5":
  30.  
  31. .\" @(#)passwd.5 1.26 90/02/15 SMI; from UCB 4.3 BSD and SVR3
  32. .TH PASSWD 5 "31 December 1992"
  33. .SH NAME
  34. passwd \- password file
  35. .SH SYNOPSIS
  36. .B /etc/passwd
  37. .SH DESCRIPTION
  38. .IX  "passwd file"  ""  "\fLpasswd\fP \(em password file"
  39. .LP
  40. The
  41. .B passwd
  42. file contains basic information about each
  43. user's account.  This file contains a one-line
  44. entry for each authorized user, of the form:
  45. .IP
  46. .nh
  47. .IB username : password : uid :\c
  48. .IB gid : gcos-field : home-dir :\c
  49. .I login-shell
  50. .hy
  51. .LP
  52. where
  53. .TP 15
  54. .I username
  55. is the user's login name.  This field contains
  56. no uppercase characters, and must not be more
  57. than eight characters in length.
  58. .TP
  59. .I password
  60. is the user's encrypted password,
  61. or a string of the form:
  62. .BI ## name
  63. if the encrypted password is in the
  64. .B /etc/security/passwd.adjunct
  65. file (see
  66. .BR passwd.adjunct (5)).
  67. .IP
  68. The encrypted password consists of 13 characters chosen from a
  69. 64-character alphabet
  70. .RB ( . ,
  71. .BR / ,
  72. .BR 0 \(em 9 ,
  73. .BR A \(em Z ,
  74. .BR A \(em z )
  75. except when the password is null, in which case the encrypted password
  76. is null; if the password is null,
  77. .BR login (1)
  78. does not request a password before logging the user in.
  79. Password aging is effected for a particular user if his encrypted
  80. password in the password file is followed by a comma and a non-null
  81. string of characters from the above alphabet.  (Such a string must be
  82. introduced in the first instance by the super-user.)
  83. .IP
  84. The first character of the age,
  85. .I M
  86. say, denotes the maximum number of weeks for which a password is valid. 
  87. A user who attempts to login after his password has expired will be
  88. forced to supply a new one.  The next character,
  89. .I m
  90. say, denotes the minimum period in weeks that must expire before the
  91. password may be changed.  The remaining one or two characters define the
  92. week (counted from the beginning of 1970) when the password was last
  93. changed.  (A null string is equivalent to zero.)
  94. .I M
  95. and
  96. .I m
  97. have numerical values in the range 0\(em63 that correspond to the
  98. 64-character alphabet shown above (i.e.,
  99. .B /
  100. = 1 week;
  101. .B z
  102. = 63 weeks).  If
  103. .I m
  104. =
  105. .I M
  106. = 0 (derived from the string
  107. .B .
  108. or
  109. .BR .. )
  110. the user will be forced to change his password the next time he logs in
  111. (and the ``age'' will disappear from his entry in the password file). 
  112. If
  113. .I m
  114. >
  115. .I M
  116. (signified, e.g., by the string
  117. .BR ./ )
  118. only the super-user will be able to change the password.
  119. .TP
  120. .I "uid"
  121. is the user's numerical
  122. .SM ID
  123. for the system, which must be unique.
  124. .I uid
  125. is generally a value between 0 and 32767.
  126. .TP
  127. .I gid
  128. is the numerical
  129. .SM ID
  130. of the group that the user belongs to.
  131. .I gid
  132. is generally a value between 0 an 32767.
  133. .TP
  134. .I "gcos-field"
  135. is the user's real name, along with
  136. information to pass along in
  137. a mail-message heading.  It is called the
  138. gcos-field for historical reasons.  A
  139. .B &
  140. in this field stands for the login
  141. name (in cases where the
  142. login name appears in a user's real name).
  143. .TP
  144. .I "home-dir"
  145. is the pathname to the directory in
  146. which the user is initially
  147. positioned upon logging in.
  148. .TP
  149. .I login-shell
  150. is the user's initial shell program.
  151. If this field is empty, the
  152. default shell is
  153. .BR /usr/bin/sh .
  154. .LP
  155. The
  156. .B passwd
  157. file can also have lines beginning with a
  158. .RB ` + '
  159. (plus sign)
  160. which means to incorporate entries from the 
  161. Network Information Service
  162. (\s-1NIS\s0).
  163. There are three styles of
  164. .B +
  165. entries in this file: by itself,
  166. .B +
  167. means to insert the entire contents
  168. of the 
  169. .SM NIS
  170. password file at that point;
  171. .BI + name
  172. means to insert the entry (if any) for
  173. .I name
  174. from the 
  175. .SM NIS
  176. service at that point;
  177. .BI +@ netgroup
  178. means to insert the entries for all members of the network group
  179. .B netgroup
  180. at that point.
  181. If a
  182. .BI + name
  183. entry has a non-null
  184. .IR password ,
  185. .SM
  186. .IR gcos ,
  187. .IR home-dir ,
  188. or
  189. .I login-shell
  190. field,
  191. the value of that field overrides what is
  192. contained in the 
  193. .SM NIS
  194. service.
  195. The
  196. .I uid
  197. and
  198. .I gid
  199. fields cannot be overridden.
  200. .LP
  201. The
  202. .B passwd
  203. file can also have lines beginning with a
  204. .RB ` \- '
  205. (minus sign)
  206. which means to disallow entries from the 
  207. .SM NIS
  208. service.
  209. There are two styles of
  210. .RB ` \- '
  211. entries in this file:
  212. .BI \- name
  213. means to disallow any subsequent entries (if any) for
  214. .IR name
  215. (in this file or in the 
  216. .SM NIS
  217. service);
  218. .BI \-@ netgroup
  219. means to disallow any subsequent entries
  220. for all members of the network group
  221. .IR netgroup .
  222. .LP
  223. The password file is an
  224. .SM ASCII
  225. file that resides in the
  226. .B /etc
  227. directory.  Because the encrypted
  228. passwords on a secure system are kept in the
  229. .B passwd.adjunct
  230. file,
  231. .B /etc/passwd
  232. has general read permission on all systems,
  233. and can be used by
  234. routines that map numerical user
  235. .SM ID\s0s
  236. to names.
  237. .LP
  238. Appropriate precautions must be taken to lock the
  239. .B /etc/passwd
  240. file against simultaneous changes if it
  241. is to be edited with a text editor;
  242. .BR vipw (8)
  243. does the necessary locking.
  244. .br
  245. .ne 8
  246. .SH EXAMPLE
  247. .LP
  248. Here is a sample
  249. .B passwd
  250. file when
  251. .B passwd.adjunct
  252. does not exist:
  253. .RS
  254. .LP
  255. .ft B
  256. .nf
  257. root:q.mJzTnu8icF.:0:10:God:/:/bin/csh
  258. fred:6k/7KCFRPNVXg:508:10:% Fredericks:/usr2/fred:/bin/csh
  259. +john:
  260. +@documentation:no-login:
  261. +::::Guest
  262. .fi
  263. .ft R
  264. .LP
  265. .RE
  266. Here is a sample
  267. .B passwd
  268. file when
  269. .B passwd.adjunct
  270. does exist:
  271. .RS
  272. .LP
  273. .ft B
  274. .nf
  275. root:##root:0:10:God:/:/bin/csh
  276. fred:##fred:508:10:& Fredericks:/usr2/fred:/bin/csh
  277. +john:
  278. +@documentation:no-login:
  279. +::::Guest
  280. .fi
  281. .ft R
  282. .LP
  283. .RE
  284. In this example, there are specific entries for users
  285. .B root
  286. and
  287. .BR fred ,
  288. to assure that they can log in even when
  289. the system is running standalone.  The user
  290. .B john
  291. will have his password entry in the 
  292. .SM NIS
  293. service incorporated without change; anyone in the netgroup
  294. .B documentation
  295. will have their password field disabled,
  296. and anyone else will be able to log in with
  297. their usual password,
  298. shell, and home directory, but with a
  299. gcos-field of
  300. .BR Guest .
  301. .SH FILES
  302. .PD 0
  303. .TP 20
  304. .B /etc/passwd
  305. .TP
  306. .B /etc/security/passwd.adjunct
  307. .PD
  308. .SH "SEE ALSO"
  309. .BR login (1),
  310. .BR mail (1),
  311. .BR passwd (1),
  312. .BR crypt (3),
  313. .BR getpwent (3V),
  314. .BR group (5),
  315. .BR passwd.adjunct (5),
  316. .BR adduser (8),
  317. .BR sendmail (8),
  318. .BR vipw (8)
  319. .SH BUGS
  320. .LP
  321. .BR mail (1)
  322. and
  323. .BR sendmail (8)
  324. use the
  325. gcos-field to compose the
  326. .B From:
  327. line for addressing mail messages, but these programs get
  328. confused by nested parentheses when composing replies.
  329. This problem can be avoided by using different
  330. types of brackets within the
  331. gcos-field; for example:
  332. .RS
  333. .B
  334. (& Fredricks [Podunk U <\s-1EE/CIS\s0>] {818}-555-5555)
  335. .RE
  336. .SH NOTES
  337. .LP
  338. The Network Information Service
  339. (\s-1NIS\s0)
  340. was formerly known as Sun Yellow Pages
  341. (\s-1YP\s0). 
  342. The functionality of the two remains the same;
  343. only the name has changed.
  344.