If I for example want to know how many times a user has logged in, how can I go about this in a simple or awesome way ?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
For some very basic login information, you can use the last command. For instance:
root@web-02:~# last root
root pts/0 109.60.147.140 Wed Dec 2 10:49 still logged in
root pts/0 109.60.147.140 Wed Dec 2 10:49 - 10:49 (00:00)
wtmp begins Tue Dec 1 17:22:59 2015
Notice the history only goes back so far as the logs get rotated. You can also look at older logs by specifying the file:
root@web-02:~# last -f /var/log/wtmp.1
root pts/0 109.60.147.140 Wed Nov 18 11:21 - 11:23 (00:02)
root pts/0 109.60.147.140 Fri Nov 13 10:42 - 10:42 (00:00)
wtmp.1 begins Fri Nov 13 10:42:21 2015
For even more information, you can inspect /var/log/auth.log It will also contain information like failed login attempts.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.