Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Jun 26, 2003 10:52 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
The "last" command displays when users logged into your system, when there were reboots and shutdowns, the kernel that was booted... Example:

Code:
[root@li-20 root]# last
root     pts/1        zon122191aaa.def Thu Jun 26 14:36 - 15:25  (00:49)   
root     pts/0        zon122191aaa.def Thu Jun 26 13:11   still logged in   
root     pts/0        zon122191aaa.def Thu Jun 26 00:48 - 05:50  (05:01)   
root     tty0                          Tue Jun 24 16:59   still logged in   
reboot   system boot  2.4.21linode4-6u Tue Jun 24 16:58         (2+05:48)   

wtmp begins Tue Jun 24 16:58:25 2003
[root@li-20 root]#

It also displays where the user came from and what they connected to - (console, ftp, a terminal, etc). "tty0" is the console, where as pts (pseudo terminal) was an SSH or telnet session.

-Chris


Top
   
 Post subject:
PostPosted: Fri Jun 27, 2003 9:00 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
If you get an error message that when you run "last" that /var/log/wtmp isn't found, execute the following command:

touch /var/log/wtmp

That will create the initial file.

-Chris


Top
   
 Post subject:
PostPosted: Tue Jul 01, 2003 12:30 pm 
Offline
Junior Member

Joined: Tue Jun 17, 2003 2:18 pm
Posts: 47
Website: http://www.clan-intrepid.com
AOL: mshine311
Everytime I do the last command it says my wtmp file is this:

wtmp begins Tue Jul 1 11:40:40 2003

Is there any way so that it doesnt begin on every single day so that I can keep a running list? Thanks.


Top
   
 Post subject:
PostPosted: Tue Jul 01, 2003 12:45 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
sec39 wrote:
Everytime I do the last command it says my wtmp file is this:

wtmp begins Tue Jul 1 11:40:40 2003

Is there any way so that it doesnt begin on every single day so that I can keep a running list? Thanks.

Is there a cron job that's recreating it?

Look for /etc/logrotate.conf and edit the wtmp section -- if it says "daily" change it to "monthly" ...

-Chris


Top
   
 Post subject:
PostPosted: Tue Jul 01, 2003 12:59 pm 
Offline
Junior Member

Joined: Tue Jun 17, 2003 2:18 pm
Posts: 47
Website: http://www.clan-intrepid.com
AOL: mshine311
caker wrote:
sec39 wrote:
Everytime I do the last command it says my wtmp file is this:

wtmp begins Tue Jul 1 11:40:40 2003

Is there any way so that it doesnt begin on every single day so that I can keep a running list? Thanks.

Is there a cron job that's recreating it?

Look for /etc/logrotate.conf and edit the wtmp section -- if it says "daily" change it to "monthly" ...

-Chris


hah! word. its at monthly but ya.. today is the beginning of the month. :wink:


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group