LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-25-2011, 03:23 PM   #1
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Rep: Reputation: 32
how to detect all user logins


I would like to detect every login on my server. Not only ssh logins (virtual terminals) but also physical logins.

There is a way to use nagios or a script to watch log files. But I would like to know is there a way to catch that information one step before.

I thought about watching /dev/pts for changes but that is not different than log watching and everything does not appear in /dev/pts like a ssh tunnel (ssh -N user@server). These are only visible in logs because ssh tunnels do not open terminals.

But I would like to be able to catch these on login. Any ideas?

Thanks

p.s.: it is Debian 6.0 stable but that should not matter
 
Old 05-25-2011, 03:43 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi there,

If you are looking for heavy accounting and analysis utility then check out the following links:

http://www.cyberciti.biz/faq/list-co...n-linuxserver/

http://www.cyberciti.biz/tips/howto-...ccounting.html
 
Old 05-25-2011, 03:45 PM   #3
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Original Poster
Rep: Reputation: 32
your links are broken
 
Old 05-25-2011, 03:47 PM   #4
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
What I recommend is to tail the /var/log/messages or /var/log/auth.log and grep it to specify what type of service to output. For example:

tail -f /var/log/messages | grep sshd
 
Old 05-25-2011, 03:59 PM   #5
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Sorry:

Here are they:

http://www.cyberciti.biz/faq/list-co...n-linuxserver/

http://www.cyberciti.biz/tips/howto-...ccounting.html
 
Old 05-25-2011, 04:03 PM   #6
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Original Poster
Rep: Reputation: 32
I know about that but grepping, parsing etc log files cannot be the only or best way to detect something like this. At least I hope so.
 
Old 05-25-2011, 04:43 PM   #7
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by malo_umoran View Post
I know about that but grepping, parsing etc log files cannot be the only or best way to detect something like this. At least I hope so.
Well, there's always a thousand different ways to get the result but most Unix admin tasks can be accomplished with the core bash utilities such as grep, awk, sed and basic commands. It is really amazing what you can do as an admin for your own tasks. Mastering the core utilities takes some time but it is really a thing of wonder once you learn it. And that's just the tip of the iceberg compared to creating your own CGI admin interfaces or even custom programs written in C. The sky is the limit.
 
1 members found this post helpful.
Old 05-25-2011, 11:53 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,238

Rep: Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712
Sounds like you want a PAM module that log or run a named cmd so you can have it done in 'real time' / instantly. This is one I found http://linux.die.net/man/8/pam_exec. There may be others.
 
1 members found this post helpful.
Old 06-01-2011, 03:11 PM   #9
malo_umoran
Member
 
Registered: Dec 2003
Distribution: Desktop: Slackware 13.1 &13.37 | Server: Debian 6.0
Posts: 270

Original Poster
Rep: Reputation: 32
Sorry for a late response. Thanks, pam_exec is what I was looking for. Great.
 
  


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
Detect Remote Logins Within Shell Script JRomeo Linux - Newbie 1 04-19-2011 08:10 PM
One user login cannot start scim, other user logins and root OK allend Slackware 3 05-08-2008 07:25 PM
[vsftp] User logins, need help. Hyakutake Slackware 2 06-17-2007 07:41 AM
Restriction on user logins klmn1 Linux - Networking 2 05-26-2003 05:40 AM
User Logins TerminalPhreak Linux - Newbie 3 02-28-2003 01:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:20 PM.

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
Open Source Consulting | Domain Registration