Previous Table of Contents Index Next
Perforce 2009.2: Command Reference

p4 user
Create or edit Perforce user specifications and preferences.
p4 [g-opts] user [-f] [username]
p4 [g-opts] user -d [-f] username
p4 [g-opts] user -o [username]
p4 [g-opts] user -i [-f]
By default, any system user becomes a valid Perforce user the first time he uses any Perforce command that can update the depot or its metadata. Perforce automatically creates a user spec with default settings for the invoking user. Use the p4 user command to edit these settings or to create new user records. (After installing Perforce, use p4 protect as a Perforce superuser to prevent automatic creation of new users.)
When called without a username, p4 user edits specification of the current user. When called with a username, the user specification is displayed, but cannot be changed. The form appears in the editor defined by the P4EDITOR environment or registry variable.
Perforce superusers can create new users or edit existing users' specifications with the -f (force) flag: p4 user -f username.
The user who gives a Perforce command is not necessarily the user under whose name the command runs. The user for any particular command is determined by the following:
If the -u username flag is used on the command line (for instance, p4 -u joe submit), the command runs as that user (a password may be required);
If the above hasn't been done, but the file pointed to by the P4CONFIG environment or registry variable contains a setting for P4USER, then the command runs as that user.
If neither of the above has been done, but the P4USER environment or registry variable has been set, then the command runs as that user.
If none of the above apply, then the username is taken from the OS level USER or USERNAME environment variable.
Form Fields
The Perforce username under which p4 user was invoked. By default, this is the user's system username.
A description of the jobs to appear automatically on all new changelists (described in the Usage Notes below).
-d username
Deletes the specified user. Only user username, or the Perforce superuser, can run this command.
Superuser force flag; allows the superuser to modify or delete the specified user, or to change the last modified date.
Usage Notes
Can File Arguments Use
Revision Specifier?
The -d flag can be used by non-superusers only to delete the user specification that invoked the p4 user command. Perforce superusers can delete any Perforce user.
By default, user records are created without passwords, and any Perforce user can impersonate another by setting P4USER or by using the globally available -u flag. To prevent another user from impersonating you, set a password with the p4 passwd command.
Passwords can be created, edited, or changed in the p4 user form or by using the p4 passwd command. Setting your password in the p4 user form is only supported at security levels 0 or 1. You can p4 passwd to set passwords at any server security level, and you must use p4 passwd to set passwords at higher security levels. For more about how the various security levels, see the System Administrator's Guide.
If you edit a password in the p4 user form, do not use the comment character # within the password; Perforce interprets everything following that character on the same line as a comment, and does not store it as part of the password.
Passwords are displayed as six asterisks in the p4 user form regardless of their length.
If you are using ticket-based authentication (see p4 login for details), changing your password automatically invalidates all of your outstanding tickets.
The collected values of the Email: fields can be listed for each user with the p4 users command, and can used for any purpose.
The p4 reviews command, which is used by the Perforce change review daemon, uses the values in the Reviews: field; when activated, it will send email to users whenever files they've subscribed to in the Reviews: field have changed. Files listed in this field must be specified in depot syntax; for example, if user joe has a Reviews: field value of
then the change review daemon sends joe email whenever any README file has been submitted, and whenever any file under //depot/main has been submitted.
in your Reviews: field, you will receive email when jobs are changed.
If you set the Jobview: field to any valid jobview, jobs matching the jobview appear on any changelists created by this user. Jobs that are fixed by the changelist should be left in the changelist when it's submitted with p4 submit; other jobs should be deleted from the form before submission.
For example, suppose the jobs at your site have a field called Owned-By:. If you set the Jobview: field on your p4 user form to Owned-By=yourname&status=open, all open jobs owned by you appear on all changelists you create. See p4 jobs for a full description of jobview usage and syntax.
Run p4 submit as user joe, whose password is hey.
Create a new Perforce user named joe2 if the caller is a Perforce superuser, and joe2 doesn't already exist as a Perforce user. If user joe2 already exists, allow a Perforce superuser to modify the user's settings.
Related Commands

Previous Table of Contents Index Next

Perforce 2009.2: Command Reference
Copyright 1999-2009 Perforce Software.