Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
CHPASS(1)		FreeBSD	General	Commands Manual		     CHPASS(1)

     base information

     chpass [-a	list] [-e expiretime] [-p encpass] [-s newshell] [user]
     ypchpass [-loy] [-a list] [-d domain] [-e expiretime] [-h host]

     The chpass	utility	allows editing of the user database information	asso-
     ciated with user or, by default, the current user.

     to	chpass.	 (There	is only	one program.)

     The information is	formatted and supplied to an editor for	changes.


     The options are as	follows:

     -a	list	    The	super-user is allowed to directly supply a user	data-
		    base entry,	in the format specified	by passwd(5), as an
		    argument.  This argument must be a colon (":") separated
		    list of all	the user database fields, although they	may be

     -e	expiretime  Change the account expire time.  This option is used to
		    set	the expire time	from a script as if it was done	in the
		    interactive	editor.

     -p	encpass	    The	super-user is allowed to directly supply an encrypted
		    password field, in the format used by crypt(3), as an ar-

     -s	newshell    Attempt to change the user's shell to newshell.

     Possible display items are	as follows:

	   Login:	       user's login name
	   Password:	       user's encrypted	password
	   Uid:		       user's login
	   Gid:		       user's login group
	   Class:	       user's general classification
	   Change:	       password	change time
	   Expire:	       account expiration time
	   Full	Name:	       user's real name
	   Office Location:    user's office location (1)
	   Office Phone:       user's office phone (1)
	   Home	Phone:	       user's home phone (1)
	   Other Information:  any locally defined parameters for user (1)
	   Home	Directory:     user's home directory
	   Shell:	       user's login shell

			       are comma-delimited fields embedded in the
			       FullName	field.


     The password field	contains the encrypted form of the user's password.

     of	systems) as they control file access.

     While it is possible to have multiple entries with	identical login	names
     that manipulate these files will often return only	one of the multiple
     entries, and that one by random selection.


     typically used to initialize the user's system resource limits when they


     The expire	field is the date on which the account expires.

     Both the change and expire	fields should be entered in the	form "month
     day year" where month is the month	name (the first	three characters are

     Five fields are available for storing the user's full name, office
     location, work and	home telephone numbers and finally other information
     which is a	single comma delimited string to represent any additional
     under the heading Office:.

     be	placed at login.

     as	a shell	not found in /etc/shells.

     the user database.


     PW_SCAN_BIG_IDS environment variable.

     requires password authentication before it	will make any changes.	The
     only user allowed to submit changes without supplying a password is the
     master server already has the privileges required to make updates to the


     Consequently, except where	noted, the following restrictions apply	when
     chpass is used with NIS:

		other fields are restricted, even when chpass is invoked by
		the super-user.	 While support for changing other fields could
		be added, this would lead to compatibility problems with other

		ted to change any field.

	   2.	Password authentication	is required.  The chpass utility will
		prompt for the user's NIS password before effecting any

		to submit changes without supplying a password.	 (The super-
		described below.)

	   3.	Adding new records to the local	password database is
		discouraged.  The chpass utility will allow the	administrator
		to add new records to the local	password database while	NIS is
		enabled, but this can lead to some confusion since the new
		records	are appended to	the end	of the master password file,
		usually	after the special NIS '+' entries.  The	administrator
		is running.

		new records to the NIS password	maps, provided the
		permitted additions (it	refuses	them by	default).  The chpass
		utility	tries to update	the local password database by de-
		fault; to update the NIS maps instead, invoke chpass with the
		-y flag.

	   4.	Password changes are not permitted.  Users should use
		the "Password:"	field does not show up in the editor template,
		the super-user may add it back by hand), but even the super-
		user must supply the user's original password otherwise
		rpc.yppasswdd(8) will refuse to	update the NIS maps.

		ted to change a	user's NIS password with chpass.

     compiled with NIS support:

     -d	domain	Specify	a particular NIS domain.  The chpass utility uses the
		utility.  The -d option	can be used to override	a default, or
		to specify a domain when the system domain name	is not set.

     -h	host	Specify	the name or address of an NIS server to	query.	Nor-
		mally, chpass will communicate with the	NIS master host	speci-
		fied in	the master.passwd or passwd maps.  On hosts that have
		not been configured as NIS clients, there is no	way for	the
		program	to determine this information unless the user provides
		the hostname of	a server.  Note	that the specified hostname
		need not be that of the	NIS master server; the name of any
		server,	master or slave, in a given NIS	domain will do.

		When using the -d option, the hostname defaults	to
		"localhost".  The -h option can	be used	in conjunction with
		the -d option, in which	case the user-specified	hostname will
		override the default.

     -l		Force chpass to	modify the local copy of a user's password in-
		formation in the event that a user exists in both the local
		and NIS	databases.

		rpc.yppasswdd(8) ("old-mode").	When invoked by	the super-user
		on the NIS master server, chpass allows	unrestricted changes
		to the NIS passwd maps using dedicated,	non-RPC-based mecha-
		nism (in this case, a UNIX domain socket).  The	-o flag	can be
		used to	force chpass to	use the	standard update	mechanism in-
		stead.	This option is provided	mainly for testing purposes.

		chpass operates	on NIS entries by default if NIS is enabled.

     /etc/master.passwd	 the user database
     /etc/passwd	 a Version 7 format password file
     /etc/chpass.XXXXXX	 temporary copy	of the password	file
     /etc/shells	 the list of approved shells

     Change the	shell of the current user to `/usr/local/bin/zsh':

	   chsh	-s /usr/local/bin/zsh


     Robert Morris and Ken Thompson, UNIX Password security.

     The chpass	utility	appeared in 4.3BSD-Reno.

     User information should (and eventually will) be stored elsewhere.

FreeBSD	13.0		       November	17, 2020		  FreeBSD 13.0


Want to link to this manual page? Use this URL:

home | help