Disabling User Auto Creation

Info & Tags

Article #:
536
Created:
07/24/06
Modified:
08/19/08

Links

  1. Deleting Users
    Deleting Users section of Admin Guide: Chapter 3
  2. Preventing Accidental User Creation
    Tech Note
  3. p4 user
    Command Reference

SUMMARY

Perforce's default behavior is to automatically create users when they first log into Perforce, if they don't currently exist. Users are automatically created until the server reaches the number of users determined by their current license. A Perforce server administrator may want to disable this feature to avoid unnecessarily creating user accounts in Perforce.

DETAILS

You disable user auto-creation by removing all generic "user" protections (user protections using the "*" wild card for the user name) from your Perforce protections table and using "groups" and individual users instead. In this example, the Perforce administrator wants to give everyone write access to the depot while keeping a specific "super" user account:

Example
  1. Save a list of all your users. Unix based systems or Windows systems with Cygwin installed can use this command:
    p4 users | cut -d " " -f 1
    This will create a list of user names you can cut and paste, or save to a file.

  2. Create a group for all of your users:
    p4 group all_users
    The group specification will open in your default editor.

  3. Add the list of users to the "Users" field of the group specification.

  4. Save the group and quit the text editor.

  5. Open your Perforce protections table:
    p4 protect
    
    The protections table will open in your default editor.

  6. Add a line to the protections table for the new group:
    write group all_users //... 
    
  7. Delete the line that grants all users any access to the depot similar to:
    write user * //... 
    Do not grant any permissions to all users ("user *"). Grant permissions only to groups and individual users, and user "group *" as a substitute for "user *".
Notes
For more information see Perforce Tech Note 39, "Preventing Accidental User Creation"

You might also be interested in Chapter 3 of the System Administrator's Guide for information on deleting users.