cPanel Control Panel "Last Login" clarification

martin MHC

Well-Known Member
Sep 14, 2016
338
75
78
UK
cPanel Access Level
Root Administrator
Hello
I have numerous CPanel accounts I usually access via WHM, and many of these accounts have a "CPanel Last Login" on the mainpage of the CPanel, something like:

*******************
**General Information**

Current User : example
Primary Domain : example.tld
Home Directory : /home/example
Last Login : 1.2.3.4
Theme : paper_lantern

*******************

Now, This is not my IP and clients do not have access directly to CPanel, so I am curious where this IP address comes from?

Does this IP address include email accesses to account emails? I also assume this IP address is account specific rather than server specific (I have many CPanels on one server).

If not, where else can this IP address come from, because as I say, if it's not me and not my server folks (it isn't) and not email accounts, then the option left is that it's someone else logging in using the CPanel login.

Obviously this would be an issue, and I do know that ultimately this can be checked with the reference to the logs file ( cPanel login logs ) but I would rather have a clear idea of the method of this "Last Login" report generation.

Thank you for the clarifications.
 
Last edited by a moderator:
  • Like
Reactions: prodjex

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello,

The last login feature will only update the the IP address that logs in via cPanel if it's different than the previous entry. In other words, if you directly view the /home/$username/.lastlogin file, the IP address displayed in cPanel should be the last IP address listed in this file that's not your own. Here's an example of the output from this file on a test system:

Code:
10.1.1.1 # 2016-10-04 16:40:39 -0500
10.2.2.2# 2016-10-27 14:33:05 -0500
If my IP address is "10.2.2.2", then I would see "10.1.1.1" in cPanel because it's the most recent entry in this file that isn't my own IP address. In addition, if I continue to login as "10.2.2.2", the file isn't updated unless the IP address logging in changes.

I've opened a case with our documentation team to update the following document to better reflect this behavior.

The cPanel Interface - Documentation - cPanel Documentation

Thank you.
 
  • Like
Reactions: prodjex

martin MHC

Well-Known Member
Sep 14, 2016
338
75
78
UK
cPanel Access Level
Root Administrator
Thanks for the feedback, Michael. Exploring the .lastlogin file does put my mind at rest. Perhaps if CPanel can add a date/time detail to the info (for instance an HTML title tag) on the CPanel main page that would be very helpful (I imagine easily extracted from the comment data). I guess I should submit a feature request for this.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
  • Like
Reactions: prodjex