p4 login
Log in to the Helix Core Server by obtaining a ticket.
Syntax
p4 [g-opts] login [-s | -p] [-a | -h host] [user]
p4 [g-opts] login [-a -p] -r remotespec [--remote-user=X]
p4 [g-opts] login [-s] -r remotespec [--remote-user=X]
Description
The p4 login
command authenticates a user and creates a ticket that represents a session with the Helix Core Server. An
authenticated user can access the Helix Core Server until
the ticket expires or the user is logged out by the p4 logout
command.
By default, tickets are valid for 12
hours. This value can be set for any group in the p4
group
form.
Login attempts, whether successful or not, are logged to a structured log file. (See Structured logs in the Helix Core Server Administrator Guide.) If the attempt to log in fails, the reason is included in the log. In the case of authentication triggers or LDAP authentication (see p4 ldap), the parts of the error message that contain user data are sanitized as needed.
If you use LDAP authentication, you can set the getattrs
option in the ldap spec Options
field to specify whether the
Fullname
and Email
fields for users created by
p4 login
are populated from the directory.
See also Login process for the user in the Helix Core Server Administrator Guide.
Options
|
Obtain a ticket for the user that is valid on all the client workstations of this Helix Core Server. Logging in with |
|
Request a ticket that is valid for the specified host IP
address. This option is typically used with the |
|
Display the ticket, rather than storing it in the local ticket file. |
|
Specify the remote server to which the login will automatically be
forwarded. The login will be for the user specified by the |
|
Display the status of the current ticket, if one exists. Use with -a to display the status for all hosts, or with -h host to display the status for a specfic host. Users with super access can provide a username argument to display the status of that username's ticket. (See the Examples.) |
user
|
(For the user with
Non-superusers who attempt to log in as
other users must use the |
|
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 |
available to an operator user and a service user |
- To create tickets that do not expire, set the timeout value to
unlimited
in thep4 group
form. - By default, after
3
failed login attempts, a user must wait up to ten seconds before logging in again. Helix Core Server superusers can change that default of3
by setting thedm.user.loginattempts
configurable. - 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. - 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. - In replicated environments, logging in to the master server does not log you in to any replica servers.
- To learn about "p4 login behavior with an auth-check-sso trigger", see Single sign-on and auth-check-sso triggers in the Helix Core Server Administrator Guide.
Examples
|
Prompt the user for a password. If the password is entered correctly, issue a ticket that is valid on the user’s machine. |
|
Attempt to log in as user |
p4 login -s maria |
Get the status of the specified user's ticket. The output might be: User maria ticket expires in 430808 hours 17 minutes. |
Related commands
To end a login session |
|
To display tickets |