How to Find recent cPanel login sessions via SSH? [EASY GUIDE]☑️

Описание к видео How to Find recent cPanel login sessions via SSH? [EASY GUIDE]☑️

Today in this video you will about 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 -   / redserverhost.com  

Facebook Page-   / redserverhost  
Twitter Page-   / redserverhost.com  
Official Website- https://redserverhost.com

If you have any query, feel free to let us know via the comments section below.

Комментарии

Информация по комментариям в разработке