I have an issue where users are trying to log in to their perforce account using p4 (not p4v), but it seems to start at a default account without permissions. When they try to logout with p4 logout
, they get "Access for user "foo" has not been enabled by 'p4 protect'".
What is the standard way of logging out and logging in via p4?
Perforce uses two environment variables,
P4PORT
andP4USER
(there are others, but these are the two you need). IfP4PORT
is undefined, it'll default toperforce:1666
and ifP4USER
is undefined, it'll default to the currently logged in username (on Linux it gets this form theUSER
variable). If that user doesn't exist in perforce, you'll see the message you described.If you need clients to log in as a different username from their Linux one, they need to run:
The error occurs if the server hasn't been set up to automatically create a user account on first access; and the username defned in
P4USER
(or the inferred one fromUSER
) doesn't exist in the database.