Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-20-2014, 12:13 PM   #1
LQ Newbie
Registered: Dec 2011
Location: USA
Distribution: RHEL5, RHEL6, CentOS
Posts: 8

Rep: Reputation: Disabled
Cool Listing of last logged in users (last command)

After running "uptime" command I discovered that my server rebooted a few days ago. I'm trying to find out who did it by running a "last" command. But the result is rather confusing for me. Normally the output gives you a bunch of lines that looks similar to this:

<user> pts/3...........<server>.....Mon Feb 24 13:04 - 15:05 (1+02:00)

However, one of the output, which is the actual date and time that the reboot is suspected to have happen, shows this:

reboot system boot 2.6.18-371.1.2.el5 Fri Mar 14 12:30 (5+06:20)

Does the output above mean that the system rebooted by itself? How come there's no username and server name associated with that reboot? Any assistance would be much appreciated.
Old 03-20-2014, 12:28 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,798

Rep: Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749Reputation: 749
reboot means the system came up at that time. The line is logged by pseudo-user "reboot". last has no idea what caused the system to go down. The lines just before reboot tell you who was logged in at the time, but nothing can tell you if someone pulled the plug out and then restarted the system, for example.
Old 03-20-2014, 10:48 PM   #3
Registered: Jul 2012
Distribution: Arch, Debian, and CentOS/RHEL
Posts: 539

Rep: Reputation: 56
Okay, so, how do we then determine why a certain server shutdown? I believe /var/log/messages logs the boot up and shutdown of a system. If there are messages indicating the bootup but no shutdown before it, could we assume that the shutdown was caused by things like power outages?

Old 03-21-2014, 12:51 AM   #4
Registered: Jul 2009
Location: Brisbane
Distribution: RHEL 6.5
Posts: 39

Rep: Reputation: 0

Can you not do:
grep -ri "init 6" /home*
Or grep for "shutdown" or "reboot"... Look in the .bash_history.

Old 03-21-2014, 01:31 AM   #5
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,395

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
As smallpond indicated, use the 'reboot' timestamp as a guide and investigate the logfiles for recs immediately before that and check who was logged on at the time.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sftp ls command, short listing vs long listing slufoot80 Linux - General 3 02-05-2013 10:40 AM
Bash command to list users logged in at 5pm F4U57 Linux - Newbie 2 06-07-2010 10:37 PM
Logged in users xlordt Linux - Newbie 3 11-01-2007 10:54 PM
4 of the same users logged on... true_atlantis Linux - Newbie 1 04-13-2006 11:54 PM
No Users logged in X kaise_sose Linux - Software 2 10-19-2004 02:57 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:46 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration