Previous Table of Contents Index Next
Perforce 2009.2: Command Reference



p4 login
Synopsis
Log in to a Perforce server by obtaining a ticket.
Syntax
p4 [g-opts] login [ -a -p ] [ user ]
p4 [g-opts] login [ -s ]
Description
The p4 login command authenticates a user and creates a ticket that represents a session with a Perforce server. Once authenticated, a user can access the Perforce server until either the ticket expires or until the user issues the p4 logout command.
By default, tickets are valid for 12 hours.
To obtain a ticket valid for all IP addresses (for instance, to use Perforce simultaneously on more than one machine), use p4 login -a. Users with tickets that are valid for all IP addresses still consume only one Perforce license.
Options
Usage Notes
Can File Arguments Use
Revision Specifier?
To extend a ticket's lifespan, use p4 login while already logged in. Your ticket's lifespan is extended by 1/3 of its initial timeout setting, subject to a maximum of your ticket's initial timeout setting.
Perforce superusers can obtain login tickets for users other than themselves without entering passwords. Non-superusers who attempt to log in as other users must use the p4 -u username login form of the command, and correctly supply the other user's password.
Tickets are stored in the file specified by the P4TICKETS environment variable. If this variable is not set, tickets are stored in %USERPROFILE%\p4tickets.txt on Windows, and in $HOME/.p4tickets on other operating systems.
Examples
Prompt the user for a password; if the password is entered correctly, issue a ticket valid on the user's machine.
Attempt to log in as user builder; if the password is entered correctly, issue a ticket valid on all machines.
Related Commands
 


Previous Table of Contents Index Next

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