LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-08-2009, 08:15 AM   #1
planetmars
LQ Newbie
 
Registered: Nov 2008
Posts: 22

Rep: Reputation: 15
How to disable lastlog file in /var/log


whenever some one logs in to the RHEL 4 server, his details are put in this lastlog file. Are there any other files that keep the info about logins (either successful or failed attempts) ?

How to stop lastlog file getting updated with the user id every time someone logs in ?
 
Old 10-08-2009, 09:00 AM   #2
Doculus
LQ Newbie
 
Registered: Oct 2009
Distribution: Gentoo
Posts: 29

Rep: Reputation: 17
There is two ways to do it, depending on distro release, you shuld check yours, as I don not have it:
- the old method is in /etc/login.defs, comment "LASTLOG_ENAB"
- the new method is in /etc/pam.d/login, comment "session optional pam_lastlog.so"
 
Old 10-08-2009, 06:20 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,362

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
Why would you want to disable it?
 
Old 10-08-2009, 08:33 PM   #4
planetmars
LQ Newbie
 
Registered: Nov 2008
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Doculus View Post
There is two ways to do it, depending on distro release, you shuld check yours, as I don not have it:
- the old method is in /etc/login.defs, comment "LASTLOG_ENAB"
- the new method is in /etc/pam.d/login, comment "session optional pam_lastlog.so"
Thanks
 
Old 10-09-2009, 10:03 PM   #5
planetmars
LQ Newbie
 
Registered: Nov 2008
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Doculus View Post
There is two ways to do it, depending on distro release, you shuld check yours, as I don not have it:
- the old method is in /etc/login.defs, comment "LASTLOG_ENAB"
- the new method is in /etc/pam.d/login, comment "session optional pam_lastlog.so"
There is no line containing "LASTLOG_ENAB" in the file login.defs
There is no line containing "session optional pam_lastlog.so" in the file login

I found the following commands that display the previous login details

last
lastb
lastcomm
lastlog

These commands get the data from
var/log/btmp
var/run/utmp
var/log/wtmp

how to disable the process that writes the IP addr of the person who logs in ?
 
Old 10-09-2009, 11:52 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
And again the question: why?

That's a very basic sanity check, and a fundamental auditing feature. Turning that off
is like removing the hand-break from your car.

The only "reason" I can think of for wanting to disable that is that you want to open
back-doors for people. Not a good reason.


Cheers,
Tink
 
  


Reply


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
setting file permissions for file /var/log/Xorg.0.log mfb Linux - Security 1 07-07-2009 01:41 PM
/var/log/lastlog 400G - on a 300G filesystem!! bagpussnz Linux - Server 4 01-09-2009 01:42 AM
Can Samhain log my entries in /var/log/secure and /var/log/mesage to a central server abefroman Linux - Software 2 04-13-2008 04:13 PM
/var/log/lastlog missing zQUEz Linux - Server 2 08-08-2007 07:38 PM
/var/log/lastlog size ??? nabil Linux - General 0 10-09-2002 06:04 PM


All times are GMT -5. The time now is 09:06 AM.

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