sniff /dev/tty


 
Thread Tools Search this Thread
Top Forums Programming sniff /dev/tty
# 1  
Old 02-08-2008
sniff /dev/tty

hello all,

Being root, I would like to log user activity (also multiple root activity), i don't really like
history file based logging, lets assume that users have access to their .profile.

I would like to write a monitoring daemon in C that would capture /dev/ttys,
so I need to do a non-blocking read to the stream ...

any ideas?

thanks a lot. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Python: Redirecting to tty and reading from tty

In bash, you can do something like this: #!/bin/bash echo -n "What is your name? " > /dev/tty read thename < /dev/tty How can I do the same in python? I have a python script that has the following content: #!/usr/bin/python2.7 import getpass import sys import telnetlib import... (2 Replies)
Discussion started by: SkySmart
2 Replies

2. Shell Programming and Scripting

Simply question about capturing output to /dev/tty

Suppose another person wrote the following one-line shell script: echo $RANDOM > /dev/tty QUESTION #1: How can the random number, which is output to the terminal by this script, be captured in a variable? QUESTION #2: How can this be done in a cron job? Specific code, whether in ksh or... (1 Reply)
Discussion started by: Paul R
1 Replies

3. UNIX for Dummies Questions & Answers

Reading password from /dev/tty

hi, From the below script: ##########################################pwd_auth.sh######################################################################################## #Author: Pandeeswaran Bhoopathy #Written on:26th Jan 2012 2:00PM #This script describes the feature of stty and illustrates... (3 Replies)
Discussion started by: pandeesh
3 Replies

4. UNIX for Dummies Questions & Answers

/dev/tty find last modified time

what can I use to find the last modified time of a /dev/tty ? (4 Replies)
Discussion started by: l flipboi l
4 Replies

5. Programming

Create a pipe to /dev/tty

Hello everybody: I have a child process which reads a password from /dev/tty, as far as I know file descriptors for the child process can be seen by using lsof, so I want to connect to such device in order to send the password through a pipe, how could I do that? (2 Replies)
Discussion started by: edgarvm
2 Replies

6. UNIX for Dummies Questions & Answers

read from terminal/keyboard > /dev/tty

Hi, I need to provide more than one character to "> /dev/tty" through terminal/keyboard input, I have this: ok=false while do echo " Enter r1 to reformat " > /dev/tty read choice case $choice in ) echo " bla bla bla " ;; done However, in this way,... (3 Replies)
Discussion started by: Gery
3 Replies

7. Programming

What happens on opening /dev/tty failure?

Since the existence of /dev/tty is not guaranteed, what happens when an attempt is made to open /dev/tty and there's no controlling terminal? Will it fail, or open /dev/null instead? Or do something else? So is checking for NULL in the code below a safe way of checking whether opening... (2 Replies)
Discussion started by: gencon
2 Replies

8. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

9. Cybersecurity

Ethernet sniff.

I suspect that someone is using a sniffer on my Ethernet connection, OS X 10.3.9, DSL, ok, I'm in terminal using the "ifconfig" command > flags=8049<UP,LOOPBACK,RUNNING,MULTICAST>mtu 16384 right, it's not in "promiscuous mode", but i think it's Trojaned, can anyone point me in the... (1 Reply)
Discussion started by: su"do"er
1 Replies

10. UNIX for Dummies Questions & Answers

Cannot open "/dev/tty"

Hi, When it proccesing the backup with cpio report this message: Cannot open "/dev/tty" and cancel de backup. Cuando se procesa la tarea del backup reporta el error: Cannot open "/dev/tty" y cancela el backup y no termina correctamente, a que se devera esta advertencia. Gracias. Thacks.... (3 Replies)
Discussion started by: cmr88
3 Replies
Login or Register to Ask a Question
PAM_SECURETTY(8)						 Linux-PAM Manual						  PAM_SECURETTY(8)

NAME
pam_securetty - Limit root login to special devices SYNOPSIS
pam_securetty.so [debug] DESCRIPTION
pam_securetty is a PAM module that allows root logins only if the user is logging in on a "secure" tty, as defined by the listing in /etc/securetty. pam_securetty also checks to make sure that /etc/securetty is a plain file and not world writable. It will also allow root logins on the tty specified with console= switch on the kernel command line and on ttys from the /sys/class/tty/console/active. This module has no effect on non-root users and requires that the application fills in the PAM_TTY item correctly. For canonical usage, should be listed as a required authentication method before any sufficient authentication methods. OPTIONS
debug Print debug information. noconsole Do not automatically allow root logins on the kernel console device, as specified on the kernel command line or by the sys file, if it is not also specified in the /etc/securetty file. MODULE TYPES PROVIDED
Only the auth module type is provided. RETURN VALUES
PAM_SUCCESS The user is allowed to continue authentication. Either the user is not root, or the root user is trying to log in on an acceptable device. PAM_AUTH_ERR Authentication is rejected. Either root is attempting to log in via an unacceptable device, or the /etc/securetty file is world writable or not a normal file. PAM_INCOMPLETE An application error occurred. pam_securetty was not able to get information it required from the application that called it. PAM_SERVICE_ERR An error occurred while the module was determining the user's name or tty, or the module could not open /etc/securetty. PAM_USER_UNKNOWN The module could not find the user name in the /etc/passwd file to verify whether the user had a UID of 0. Therefore, the results of running this module are ignored. EXAMPLES
auth required pam_securetty.so auth required pam_unix.so SEE ALSO
securetty(5), pam.conf(5), pam.d(5), pam(7) AUTHOR
pam_securetty was written by Elliot Lee <sopwith@cuc.edu>. Linux-PAM Manual 09/19/2013 PAM_SECURETTY(8)