Linux: View what users are / were logged on a system

There are several simple commands to show what users are logged a Linux systems. Logo_linux_Pinguin

The following commands are standard in all distributions (as of date)

w

who

who –a

who and users show who are currently logged on. You can also use last:

last

Another possibility is to get the users-information from the systems logs:

grep sshd /var/log/messages

grep-out Failed login attempts 

grep sshd /var/log/messages | grep -i "Failed" | awk ‘{print $NF}’ | sort|uniq -c|sort -n

see access thru httpd

cat /var/log/httpd/access_log

Leave a Reply

Your email address will not be published. Required fields are marked *