Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Utility to notify root of user logins? (not via email)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jlmcp
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2005
Posts: 134

PostPosted: Thu May 15, 2014 8:29 pm    Post subject: Utility to notify root of user logins? (not via email) Reply with quote

All-

Did some searching on this and came up empty handed. Please redirect me if I missed a relevant thread somewhere.

I am trying to find a script, utility, or means to notify the root user when other users (including root) authenticate to my server. I know there are a bunch of ways to have alerts like this delivered via e-mail, but we are not running a mail service in this environment. More useful would be to have an alert pop on the console with a line such as:

Code:
server #
Alert! User `bobj` just logged on from IP 3.4.5.6 at pty/0.
server #


What would be the most expedient way of accomplishing this?

Cheers-

Jake
_________________
Dell PowerEdge :: 3.8 GHz Pentium 4 :: 1 GB RAM :: Kernel: 2.6.36-gentoo-r2
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu May 15, 2014 9:37 pm    Post subject: Reply with quote

jlmcp wrote:
I am trying to find a script, utility, or means to notify the root user when other users (including root) authenticate to my server.

jlmcp ... not sure bash provides such a feature but zsh does ... see here.

Code:
# watch=( khayyam )
# log
khayyam has logged on 1 from .
# chvt 2
login: khayyam
password:
# echo foo >/dev/null
khayyam has logged on 2 from .

best ... khay
Back to top
View user's profile Send private message
jlmcp
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2005
Posts: 134

PostPosted: Thu May 15, 2014 9:42 pm    Post subject: Reply with quote

Yep. That's exactly what I am looking for. So, it's a likely to be a shell feature vs. a system utility ... ok ... let me retool my search.

I am using bash, as you suspected.

Jake
_________________
Dell PowerEdge :: 3.8 GHz Pentium 4 :: 1 GB RAM :: Kernel: 2.6.36-gentoo-r2
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Thu May 15, 2014 10:06 pm    Post subject: Reply with quote

jlmcp wrote:
Yep. That's exactly what I am looking for. So, it's a likely to be a shell feature vs. a system utility ... ok ... let me retool my search.

jlmcp ... yes, a shell feature ... though I suppose a daemon running in the background could also send alerts via 'echo foo > $(tty)'.

jlmcp wrote:
I am using bash, as you suspected.

well, that can be fixed with this simple .bashrc :)

Code:
exec /bin/zsh

best ... khay
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 853

PostPosted: Fri May 16, 2014 12:26 pm    Post subject: Reply with quote

You could run root-tail, to display the contents of selected log files to your root window (I do that to monitor incoming mail and activity that impacts auth.log and selected activity against the firewall), or, if not in a X-windows environment, use tailf against auth.log and have that appear in a console. You could use screen in a split window format, with `tailf /var/log/auth.log` being the contents of one of the windows.

With syslog-ng and xtail, you could have the contents of auth.log from multiple systems merged into one (console or terminal) display.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum