p4 passwd

Change a user’s Helix Server password.

Syntax

p4 [g-opts] passwd [-O oldpassword] [-P newpassword] [user]

Description

By default, user records are created without passwords, and any Helix Server user can impersonate another by setting P4USER or by using -u , which is one of the Global Options. To prevent another user from impersonating you, use p4 passwd to set your password.

Important

We recommend that you improve security by using ticket-based authentication. This requires security level 3 or higher. See Server security levels in Helix Core Server Administrator Guide: Fundamentals.

To authenticate with tickets, first set a password with p4 passwd, and then use the p4 login and p4 logout commands to manage your authentication.

You can further improve security by assigning users to groups and setting the PasswordTimeout: field in the p4 group form. If a user belongs to more than one group, the largest PasswordTimeout value applies.

For Helix Server applications on Windows and OS X that connect to Helix Server services at security levels 0 and 1, p4 passwd stores the password by using p4 set to store the MD5 hash of the password in the registry or system settings. When connecting to Helix Server services at security levels 2, 3, or 4, password hashes are neither stored in, nor read from, these locations.

Helix Server superusers can reset the passwords of individual users (or all users site-wide) with the p4 admin resetpassword command. You can also set the dm.user.resetpassword configurable (set with p4 configure) to require that any newly-created users reset the password you assigned them when you created their account.

strong password

Certain combinations of security level and Helix Server applications releases require users to set "strong" passwords. Helix Core Server defines a strong password as:

Although abcd1234 is by default, considered a strong password in an environment with the security configurable set to 2, it is too easy to guess.

Tip

To create secure password that is easy-to-remember:

  1. Start with a phrase, such as

    Perforce Enterprise-class Version Control.

  2. Make the phrase resemble a single word, such as

    PEnterprise-classVC.

  3. Represent some letters with non-alphabetical characters:

    PN2prI$-k|@zV(.

See also Server security levels in Helix Core Server Administrator Guide: Fundamentals.

If your security needs are minimal

We recommend using ticket-based authentication. However, if your security needs are minimal, you can use one of these methods:

Method 1: Set the environment variable P4PASSWD to the password value.

Method 2: Create a setting for P4PASSWD within the P4CONFIG file. This method overrides Method 1.

Method 3: Use the -P password option on the command line. For example, p4 -u bruno -P &~#,4*0O sync allows the administrator to invoke the p4 synch command as the user named bruno. This method overrides Method 1 and Method 2.

Depending on the security level of your installation, one or more of these methods might not be permitted. See the "Server security levels" topic in Helix Core Server Administrator Guide: Fundamentals.

Options

-O oldpassword

Avoid prompting by specifying the old password on the command line. This option is not supported if your site is configured to use security level 2, 3, or 4.

If you use the -O option, you must use the -P option.

-P newpassword

Avoid prompting by specifying the new password on the command line. This option is not supported if your site is configured to use security level 2, 3, or 4.

user

Superusers can provide this argument to change the password of another user.

g-opts

See Global Options.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

N/A

N/A

list

Examples

The superuser wants to create a new user named joecoder and assign a password to that user:

p4 -u -f joecoder passwd

The server displays a user spec with default values, which the superuser accepts.

The server responds:

Enter new password:

The superuser types a password for joecoder, and the server responds:

Re-enter new password:

The superuser repeats the password, and the server responds:

Password updated.

Related Commands

To change other user options

p4 user

To change users' access levels

p4 protect

To log in using tickets instead of passwords

p4 login

To force password reset

p4 admin resetpassword