How to Find recent cPanel login sessions via SSH? [EASY GUIDE]☑️
Today in this tutorial you will about how to find recent cPanel login sessions via SSH.But before getting started let us quick watch this short video on 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 YouTube channel –https://youtube.com/redserverhost.com
Facebook Page- https://facebook.com/redserverhost
Twitter Page- https://twitter.com/redserverhost.com
If you have any query, feel free to let us know via the comments section below.
Thanks for Reading!!!
Tags: cheap linux hosting, buy linux hosting, cheap reseller hosting, buy reseller hosting, best reseller hosting, cheap web hosting, cheapest web hosting, cheapest reseller hosting, cheap reseller host, cheap linux host, cheapest linux hosting, best linux hosting, best web hosting