[🔴LIVE] How to Find recent cPanel login sessions via SSH?
Вставка
- Опубліковано 12 вер 2024
- Today in this video we will show you how to find recent cPanel login sessions via SSH. The following command will search /usr/local/cpanel/logs/session_log and output the last three dates upon which the cPanel account was accessed:
==============================================================================
grep $USERNAME /usr/local/cpanel/logs/session_log | grep NEW | awk '{print $1}' | uniq | tail -n3
==============================================================================
(Ensure you replace $USERNAME with the username of the cPanel account to search. )
To search the recent cPanel session activity for all cPanel users on the server, execute the following command:
for user in $(whmapi1 listaccts | awk '/user:/ {print $2}'); do echo "The user $user last logged in on these dates:" ; grep $user /usr/local/cpanel/logs/session_log | grep NEW | awk '{print $1}' | uniq | tail -n3 ; done
That's it!!!
For more information, kindly follow us on social media like Twitter and Facebook and for video tutorials, subscribe to our UA-cam channel - / redserverhost.com
Facebook Page- / redserverhost
Twitter Page- / redserverhost.com
Official Website- redserverhost.com
If you have any query, feel free to let us know via the comments section below.