SlideShare a Scribd company logo
How To Audit Server – Login and Shutdown / Reboot
i | P a g e
Table of Contents
Overview.......................................................................................................................................................1
Applies To......................................................................................................................................................1
Last................................................................................................................................................................1
Last – Successful Login Info.......................................................................................................................1
Last – Display Lines ...................................................................................................................................2
Last – Full Display Lines.............................................................................................................................2
Last – RunLevel .........................................................................................................................................3
Last – Shutdown’s Information.................................................................................................................4
Last – Shutdown Information ...................................................................................................................4
Last – Reboot’s Information......................................................................................................................5
Last – Reboot Information........................................................................................................................5
Lastb..............................................................................................................................................................6
Lastb – Unsuccessful Login Info ................................................................................................................6
How To Audit Server – Login and Shutdown / Reboot
1 | P a g e
Overview
The purpose of this guide is to audit last login, reboot, shutdown actions and bad login attempts
information. Also, this command will help us in understanding how long the user has been hooked on the
server.
Applies To
Linux flavor operating systems.
Last
Last command list all the users who have logged in, information is retrieved from the file
“/var/log/wtmp”.
Last – Successful Login Info
List all the successful logins and also active login sessions on the server. Run the below command.
last
How To Audit Server – Login and Shutdown / Reboot
2 | P a g e
Last – Display Lines
To list 5 lines run the below command. Display list from “wtmp” file .
last -n 5
Last – Full Display Lines
To list full information and 5 lines run the below command. Display list from “wtmp” file. Print full login
and logout times and dates.
last -F -n 5
How To Audit Server – Login and Shutdown / Reboot
3 | P a g e
Last – RunLevel
List number of lines from the log “wtmp”. To list full information and 5 lines run the below command.
Print full login and logout times and dates.
last -x
How To Audit Server – Login and Shutdown / Reboot
4 | P a g e
Last – Shutdown’s Information
List shutdown actions performed by users. Run the below command. Display from the log “wtmp”.
last -x | grep shutdown
Last – Shutdown Information
List shutdown action performed. Run the below command. Display from the log “wtmp”.
last -x| grep shutdown | head -1
last -x | grep shutdown | head -1 | awk '{print $5,$6,$7,$8}'
How To Audit Server – Login and Shutdown / Reboot
5 | P a g e
Last – Reboot’s Information
To know the reboot actions performed by users. Run the below command.
last reboot
Last – Reboot Information
List last reboot action performed. Run the below command. Display from the log “wtmp”.
last reboot -F | head -1
last reboot -F | head -1 | awk '{print $5,$6,$7,$8,$9}'
How To Audit Server – Login and Shutdown / Reboot
6 | P a g e
Lastb
Lastb command list all the users who failed / bad logins into the system, information is retrieved from the
file “/var/log/btmp”.
Note: lastb is similar to last, though last be lists bad login information. All the parameters that are
applicable to “last” command is applicable to “lastb” as well.
Lastb – Unsuccessful Login Info
list all the failed logins for the server. Display information from the file “/var/log/btmp”.
lastb

More Related Content

What's hot (20)

PDF
How To Reset root Password on CentOS 7
VCP Muthukrishna
 
PDF
How To Install and Configure GNome on CentOS 7
VCP Muthukrishna
 
PDF
How To View Current Execution Policy PowerShell
VCP Muthukrishna
 
PDF
How To Configure Nginx Load Balancer on CentOS 7
VCP Muthukrishna
 
PDF
How to Install Configure and Use sysstat utils on RHEL 7
VCP Muthukrishna
 
PDF
How To Install and Configure Open SSH Server on Ubuntu
VCP Muthukrishna
 
PDF
How To Install and Configure SUDO on RHEL 7
VCP Muthukrishna
 
PDF
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
VCP Muthukrishna
 
PDF
Nginx bind() to 0.0.0.0:9080 failed
VCP Muthukrishna
 
PDF
How To Protect SSH Access with Fail2Ban on RHEL 7
VCP Muthukrishna
 
PDF
Configure Run Levels RHEL 7 or CentOS 7
VCP Muthukrishna
 
PDF
How To Configure SNMP Logging on RHEL 7
VCP Muthukrishna
 
PDF
How To Configure Apache VirtualHost on RHEL 7 on AWS
VCP Muthukrishna
 
PDF
Bash Script - How To Monitor Application Error Logs and Send Notification
VCP Muthukrishna
 
PDF
How To Check IE Enhanced Security Is Enabled Windows PowerShell
VCP Muthukrishna
 
PDF
How To Install and Configure SNMP on RHEL 7 or CentOS 7
VCP Muthukrishna
 
PDF
VMWare Tools Installation and Troubleshooting Guide
VCP Muthukrishna
 
PDF
How to Install MariaDB Server or MySQL Server on CentOS 7
VCP Muthukrishna
 
PDF
How to Configure OpenFiler for NFS Share
VCP Muthukrishna
 
PDF
How To Configure VNC Server on CentOS 7
VCP Muthukrishna
 
How To Reset root Password on CentOS 7
VCP Muthukrishna
 
How To Install and Configure GNome on CentOS 7
VCP Muthukrishna
 
How To View Current Execution Policy PowerShell
VCP Muthukrishna
 
How To Configure Nginx Load Balancer on CentOS 7
VCP Muthukrishna
 
How to Install Configure and Use sysstat utils on RHEL 7
VCP Muthukrishna
 
How To Install and Configure Open SSH Server on Ubuntu
VCP Muthukrishna
 
How To Install and Configure SUDO on RHEL 7
VCP Muthukrishna
 
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
VCP Muthukrishna
 
Nginx bind() to 0.0.0.0:9080 failed
VCP Muthukrishna
 
How To Protect SSH Access with Fail2Ban on RHEL 7
VCP Muthukrishna
 
Configure Run Levels RHEL 7 or CentOS 7
VCP Muthukrishna
 
How To Configure SNMP Logging on RHEL 7
VCP Muthukrishna
 
How To Configure Apache VirtualHost on RHEL 7 on AWS
VCP Muthukrishna
 
Bash Script - How To Monitor Application Error Logs and Send Notification
VCP Muthukrishna
 
How To Check IE Enhanced Security Is Enabled Windows PowerShell
VCP Muthukrishna
 
How To Install and Configure SNMP on RHEL 7 or CentOS 7
VCP Muthukrishna
 
VMWare Tools Installation and Troubleshooting Guide
VCP Muthukrishna
 
How to Install MariaDB Server or MySQL Server on CentOS 7
VCP Muthukrishna
 
How to Configure OpenFiler for NFS Share
VCP Muthukrishna
 
How To Configure VNC Server on CentOS 7
VCP Muthukrishna
 

Viewers also liked (20)

PDF
How to Install and Configure AWS CLI on RHEL 7
VCP Muthukrishna
 
PDF
Bash Script Disk Space Utilization Report and EMail
VCP Muthukrishna
 
PDF
File Space Usage Information and EMail Report - Shell Script
VCP Muthukrishna
 
PDF
Installation CentOS 6.3
VCP Muthukrishna
 
PDF
DNF Failed To Open Cache
VCP Muthukrishna
 
PDF
How To Manage Yum Packages Interactive Shell
VCP Muthukrishna
 
PDF
Shell Script to Extract IP Address, MAC Address Information
VCP Muthukrishna
 
PDF
How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7
VCP Muthukrishna
 
PDF
How To Install OpenFire in CentOS 7
VCP Muthukrishna
 
PDF
How to Troubleshoot SELinux Audit2Allow unable to open (null)
VCP Muthukrishna
 
PDF
How To Install and Configure AWS CLI on RHEL 7
VCP Muthukrishna
 
PDF
How to Manage journalctl Logging System on RHEL 7
VCP Muthukrishna
 
PDF
How To Manage Yum Repositories
VCP Muthukrishna
 
PDF
How To Manage Services on RHEL 7 or CentOS 7
VCP Muthukrishna
 
PDF
How To Manage Yum Packages - Group Packages
VCP Muthukrishna
 
PDF
How To Manage Yum History
VCP Muthukrishna
 
PDF
How To Install and Configure Splunk on RHEL 7 in AWS
VCP Muthukrishna
 
PDF
How To Manage Yum Cache
VCP Muthukrishna
 
PDF
How To List YUM Packages
VCP Muthukrishna
 
PDF
Shell Script Disk Usage Report and E-Mail Current Threshold Status
VCP Muthukrishna
 
How to Install and Configure AWS CLI on RHEL 7
VCP Muthukrishna
 
Bash Script Disk Space Utilization Report and EMail
VCP Muthukrishna
 
File Space Usage Information and EMail Report - Shell Script
VCP Muthukrishna
 
Installation CentOS 6.3
VCP Muthukrishna
 
DNF Failed To Open Cache
VCP Muthukrishna
 
How To Manage Yum Packages Interactive Shell
VCP Muthukrishna
 
Shell Script to Extract IP Address, MAC Address Information
VCP Muthukrishna
 
How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7
VCP Muthukrishna
 
How To Install OpenFire in CentOS 7
VCP Muthukrishna
 
How to Troubleshoot SELinux Audit2Allow unable to open (null)
VCP Muthukrishna
 
How To Install and Configure AWS CLI on RHEL 7
VCP Muthukrishna
 
How to Manage journalctl Logging System on RHEL 7
VCP Muthukrishna
 
How To Manage Yum Repositories
VCP Muthukrishna
 
How To Manage Services on RHEL 7 or CentOS 7
VCP Muthukrishna
 
How To Manage Yum Packages - Group Packages
VCP Muthukrishna
 
How To Manage Yum History
VCP Muthukrishna
 
How To Install and Configure Splunk on RHEL 7 in AWS
VCP Muthukrishna
 
How To Manage Yum Cache
VCP Muthukrishna
 
How To List YUM Packages
VCP Muthukrishna
 
Shell Script Disk Usage Report and E-Mail Current Threshold Status
VCP Muthukrishna
 
Ad

Similar to How To Audit Server Login and Shutdown or Reboot Activity (20)

PDF
Entitlements and balancing
ِAbdulla AlShourbagy
 
PDF
Hi path 3000 & 5000 v8 manager c administrator documentation issue 6
javier videla
 
PDF
FDD-FDW-Template[Current~Future Architecture]
Rasananda BEHERA
 
PDF
FDD-FDW-Template[Current~Future Architecture]
Rasananda BEHERA
 
DOC
Sap operating manualornt
palepupavankumar
 
PDF
Admin Guide – Virtual Private Server (VPS)
webhostingguy
 
PDF
Admin Guide – Virtual Private Server (VPS)
webhostingguy
 
PDF
Admin Guide – Virtual Private Server (VPS)
webhostingguy
 
PDF
Delta v emerson_getting_started
JoseLuisPallyZegarra
 
PDF
How to Change Hostname in CentOS 7 or RHEL 7
VCP Muthukrishna
 
PDF
Student Manual _ ABT-CCP-143-TSM _ RSLogix 5000, Level 3 _ Project Development
Marco Enrique Ramos Castillo
 
PDF
1ux2y54tcwomq2gtx7pd
Juanfe1978
 
PDF
HRpM_UG_731_HDS_M2
Nicholas Pierotti
 
PDF
Teamviewer manual by PW
testtodel
 
PPT
Neoload overview
Amrita Bisht
 
PDF
How to Upgrade Openfire on CentOS 7
VCP Muthukrishna
 
PDF
7358948 questionnaire-mm
Said Ait Rais
 
PDF
Administrator guide
rturkman
 
PDF
Qtp4 bpt
Pragya Rastogi
 
PDF
Whitepaper Availability complete visibility service provider
S. Hanau
 
Entitlements and balancing
ِAbdulla AlShourbagy
 
Hi path 3000 & 5000 v8 manager c administrator documentation issue 6
javier videla
 
FDD-FDW-Template[Current~Future Architecture]
Rasananda BEHERA
 
FDD-FDW-Template[Current~Future Architecture]
Rasananda BEHERA
 
Sap operating manualornt
palepupavankumar
 
Admin Guide – Virtual Private Server (VPS)
webhostingguy
 
Admin Guide – Virtual Private Server (VPS)
webhostingguy
 
Admin Guide – Virtual Private Server (VPS)
webhostingguy
 
Delta v emerson_getting_started
JoseLuisPallyZegarra
 
How to Change Hostname in CentOS 7 or RHEL 7
VCP Muthukrishna
 
Student Manual _ ABT-CCP-143-TSM _ RSLogix 5000, Level 3 _ Project Development
Marco Enrique Ramos Castillo
 
1ux2y54tcwomq2gtx7pd
Juanfe1978
 
HRpM_UG_731_HDS_M2
Nicholas Pierotti
 
Teamviewer manual by PW
testtodel
 
Neoload overview
Amrita Bisht
 
How to Upgrade Openfire on CentOS 7
VCP Muthukrishna
 
7358948 questionnaire-mm
Said Ait Rais
 
Administrator guide
rturkman
 
Qtp4 bpt
Pragya Rastogi
 
Whitepaper Availability complete visibility service provider
S. Hanau
 
Ad

More from VCP Muthukrishna (18)

PDF
How to Fix Duplicate Packages in YUM on CentOS 7
VCP Muthukrishna
 
PDF
How To Connect to Active Directory User Validation
VCP Muthukrishna
 
PDF
How To Connect To Active Directory PowerShell
VCP Muthukrishna
 
PDF
How To List Files on Remote Server - PowerShell
VCP Muthukrishna
 
PDF
How To List Files and Display In HTML Format
VCP Muthukrishna
 
PDF
How To Check and Delete a File via PowerShell
VCP Muthukrishna
 
PDF
How To Setup SSH Keys on CentOS 7
VCP Muthukrishna
 
PDF
Windows PowerShell Basics - How To List PSDrive Info
VCP Muthukrishna
 
PDF
How To List Nginx Modules Installed / Complied on CentOS 7
VCP Muthukrishna
 
PDF
Windows PowerShell Basics – How To Create powershell for loop
VCP Muthukrishna
 
PDF
How To Construct IF and Else Conditional Statements
VCP Muthukrishna
 
PDF
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
VCP Muthukrishna
 
PDF
How To Create Power Shell Function Mandatory Parameter Value
VCP Muthukrishna
 
PDF
How To Create PowerShell Function
VCP Muthukrishna
 
PDF
How To Disable IE Enhanced Security Windows PowerShell
VCP Muthukrishna
 
PDF
How To Install and Configure Screen on CentOS 7
VCP Muthukrishna
 
PDF
How To Install and Configure Salt Master on Ubuntu
VCP Muthukrishna
 
PDF
How To Find Package Installation Date on RHEL 7
VCP Muthukrishna
 
How to Fix Duplicate Packages in YUM on CentOS 7
VCP Muthukrishna
 
How To Connect to Active Directory User Validation
VCP Muthukrishna
 
How To Connect To Active Directory PowerShell
VCP Muthukrishna
 
How To List Files on Remote Server - PowerShell
VCP Muthukrishna
 
How To List Files and Display In HTML Format
VCP Muthukrishna
 
How To Check and Delete a File via PowerShell
VCP Muthukrishna
 
How To Setup SSH Keys on CentOS 7
VCP Muthukrishna
 
Windows PowerShell Basics - How To List PSDrive Info
VCP Muthukrishna
 
How To List Nginx Modules Installed / Complied on CentOS 7
VCP Muthukrishna
 
Windows PowerShell Basics – How To Create powershell for loop
VCP Muthukrishna
 
How To Construct IF and Else Conditional Statements
VCP Muthukrishna
 
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
VCP Muthukrishna
 
How To Create Power Shell Function Mandatory Parameter Value
VCP Muthukrishna
 
How To Create PowerShell Function
VCP Muthukrishna
 
How To Disable IE Enhanced Security Windows PowerShell
VCP Muthukrishna
 
How To Install and Configure Screen on CentOS 7
VCP Muthukrishna
 
How To Install and Configure Salt Master on Ubuntu
VCP Muthukrishna
 
How To Find Package Installation Date on RHEL 7
VCP Muthukrishna
 

Recently uploaded (20)

PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
Q2 Leading a Tableau User Group - Onboarding
lward7
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Learn Computer Forensics, Second Edition
AnuraShantha7
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Q2 Leading a Tableau User Group - Onboarding
lward7
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Learn Computer Forensics, Second Edition
AnuraShantha7
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 

How To Audit Server Login and Shutdown or Reboot Activity

  • 1. How To Audit Server – Login and Shutdown / Reboot i | P a g e Table of Contents Overview.......................................................................................................................................................1 Applies To......................................................................................................................................................1 Last................................................................................................................................................................1 Last – Successful Login Info.......................................................................................................................1 Last – Display Lines ...................................................................................................................................2 Last – Full Display Lines.............................................................................................................................2 Last – RunLevel .........................................................................................................................................3 Last – Shutdown’s Information.................................................................................................................4 Last – Shutdown Information ...................................................................................................................4 Last – Reboot’s Information......................................................................................................................5 Last – Reboot Information........................................................................................................................5 Lastb..............................................................................................................................................................6 Lastb – Unsuccessful Login Info ................................................................................................................6
  • 2. How To Audit Server – Login and Shutdown / Reboot 1 | P a g e Overview The purpose of this guide is to audit last login, reboot, shutdown actions and bad login attempts information. Also, this command will help us in understanding how long the user has been hooked on the server. Applies To Linux flavor operating systems. Last Last command list all the users who have logged in, information is retrieved from the file “/var/log/wtmp”. Last – Successful Login Info List all the successful logins and also active login sessions on the server. Run the below command. last
  • 3. How To Audit Server – Login and Shutdown / Reboot 2 | P a g e Last – Display Lines To list 5 lines run the below command. Display list from “wtmp” file . last -n 5 Last – Full Display Lines To list full information and 5 lines run the below command. Display list from “wtmp” file. Print full login and logout times and dates. last -F -n 5
  • 4. How To Audit Server – Login and Shutdown / Reboot 3 | P a g e Last – RunLevel List number of lines from the log “wtmp”. To list full information and 5 lines run the below command. Print full login and logout times and dates. last -x
  • 5. How To Audit Server – Login and Shutdown / Reboot 4 | P a g e Last – Shutdown’s Information List shutdown actions performed by users. Run the below command. Display from the log “wtmp”. last -x | grep shutdown Last – Shutdown Information List shutdown action performed. Run the below command. Display from the log “wtmp”. last -x| grep shutdown | head -1 last -x | grep shutdown | head -1 | awk '{print $5,$6,$7,$8}'
  • 6. How To Audit Server – Login and Shutdown / Reboot 5 | P a g e Last – Reboot’s Information To know the reboot actions performed by users. Run the below command. last reboot Last – Reboot Information List last reboot action performed. Run the below command. Display from the log “wtmp”. last reboot -F | head -1 last reboot -F | head -1 | awk '{print $5,$6,$7,$8,$9}'
  • 7. How To Audit Server – Login and Shutdown / Reboot 6 | P a g e Lastb Lastb command list all the users who failed / bad logins into the system, information is retrieved from the file “/var/log/btmp”. Note: lastb is similar to last, though last be lists bad login information. All the parameters that are applicable to “last” command is applicable to “lastb” as well. Lastb – Unsuccessful Login Info list all the failed logins for the server. Display information from the file “/var/log/btmp”. lastb