Sponsored Content
Full Discussion: Tracing a terminal
Top Forums UNIX for Advanced & Expert Users Tracing a terminal Post 18875 by LivinFree on Thursday 4th of April 2002 01:08:25 AM
Old 04-04-2002
What Unix are you using? Some (Linux distributions specifically) come with a tool called ttysnoop, that mirrors their terminal session on another terminal you can log into. Other times (depending on the shell - this doesn't work in real time with the bash shell for example) you can simply tail -f /home/usrname/.sh_history...
If you just want to turn on auditing, knowing the Unix variant you're using is helpful, since different system log different ways.

Also, if you want a screendump of what the user is doing on the terminal (I think it only works on the /dev/tty* terminals) in Linux, look at the /dev/vcs* files. See man vcs for more info.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Tracing file modifications

Hello all! Is there a way or a utility to trace any kind of file changes in a particular directory on any UNIX machine? The purpose is that in Unix, there are multiple ways of opening and making changes to a file. But internally, there must be something common (a single pipe, etc.) that is... (3 Replies)
Discussion started by: gupta_ca
3 Replies

2. Linux

tracing

hello every one can any one help me out i just want to trace what ever i am doing in linux 8.0 in the text mode to be saved in a text file so that at the end i can see my work what i have do. its just like oracle spool so you can see your work at the end . for example what ever command u gave... (1 Reply)
Discussion started by: shary
1 Replies

3. Shell Programming and Scripting

tracing in linux

hello every one can any one help me out i just want to trace what ever i am doing in linux 8.0 in the text mode to be saved in a text file so that at the end i can see my work what i have do. its just like oracle spool so you can see your work at the end . for example what ever command u gave... (2 Replies)
Discussion started by: shary
2 Replies

4. Shell Programming and Scripting

tracing processes in shell

Is there a way to have the output from: strace -p 10101 placed in a text file so we can download it and look it over? Thanks Richard (1 Reply)
Discussion started by: ukndoit
1 Replies

5. UNIX for Dummies Questions & Answers

Tracing file installation

Hello, my first post here. I have a script to install a program which runs the user through installation interface offering several options. What I want to do is to trace the possible mistakes during the installation and send them to a logfile. I.e if a user interrupts the installation, I would... (2 Replies)
Discussion started by: tetreb
2 Replies

6. UNIX for Dummies Questions & Answers

File access tracing

Hello.. Is there anyway to check if some processes are reading one file? Id use inotify, but my kernel is 2.6.9, so it doesnt work. -k- (2 Replies)
Discussion started by: Kimmo_
2 Replies

7. Shell Programming and Scripting

Tracing a function call

Hi I am hoping someone can explain this to me as I am struggling to understand it. I had a problem today with needing to trace a ksh script that was dotting in a function that was writing to stdout. The problem was it was being run in a sub shell and the output was being parsed by the... (1 Reply)
Discussion started by: steadyonabix
1 Replies

8. Programming

Ascii vs Pcap tracing

Dear All, Which is better to use ? Ascii or Pcap tracing ? Or are they complementary ? (1 Reply)
Discussion started by: knowledgeSeeker
1 Replies

9. Shell Programming and Scripting

Cannot get terminal application to launch with a graphical launcher when successful in terminal

I have been having an extremely annoying problem. For the record, I am relatively new at this. I've only been working with unix-based OS's for roughly two years, mostly Xubuntu and some Kali. I am pretty familiar with the BASH language, as that's the default shell for debian. Now, I've made this... (16 Replies)
Discussion started by: Huitzilopochtli
16 Replies

10. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies
VCS(4)							     Linux Programmer's Manual							    VCS(4)

NAME
vcs, vcsa - virtual console memory DESCRIPTION
/dev/vcs0 is a character device with major number 7 and minor number 0, usually of mode 0644 and owner root.tty. It refers to the memory of the currently displayed virtual console terminal. /dev/vcs[1-63] are character devices for virtual console terminals, they have major number 7 and minor number 1 to 63, usually mode 0644 and owner root.tty. /dev/vcsa[0-63] are the same, but using unsigned shorts (in host byte order) that include attributes, and prefixed with four bytes giving the screen dimensions and cursor position: lines, columns, x, y. (x = y = 0 at the top left corner of the screen.) When a 512-character font is loaded, the 9th bit position can be fetched by applying the ioctl(2) VT_GETHIFONTMASK operation (available in Linux kernels 2.6.18 and above) on /dev/tty[1-63]; the value is returned in the unsigned short pointed to by the third ioctl(2) argument. These devices replace the screendump ioctl(2) operations of console(4), so the system administrator can control access using file system permissions. The devices for the first eight virtual consoles may be created by: for x in 0 1 2 3 4 5 6 7 8; do mknod -m 644 /dev/vcs$x c 7 $x; mknod -m 644 /dev/vcsa$x c 7 $[$x+128]; done chown root:tty /dev/vcs* No ioctl(2) requests are supported. FILES
/dev/vcs[0-63] /dev/vcsa[0-63] VERSIONS
Introduced with version 1.1.92 of the Linux kernel. EXAMPLE
You may do a screendump on vt3 by switching to vt1 and typing cat /dev/vcs3 >foo. Note that the output does not contain newline charac- ters, so some processing may be required, like in fold -w 81 /dev/vcs3 | lpr or (horrors) setterm -dump 3 -file /proc/self/fd/1. The /dev/vcsa0 device is used for Braille support. This program displays the character and screen attributes under the cursor of the second virtual console, then changes the background color there: #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <sys/ioctl.h> #include <linux/vt.h> int main(void) { int fd; char *device = "/dev/vcsa2"; char *console = "/dev/tty2"; struct {unsigned char lines, cols, x, y;} scrn; unsigned short s; unsigned short mask; unsigned char ch, attrib; fd = open(console, O_RDWR); if (fd < 0) { perror(console); exit(EXIT_FAILURE); } if (ioctl(fd, VT_GETHIFONTMASK, &mask) < 0) { perror("VT_GETHIFONTMASK"); exit(EXIT_FAILURE); } (void) close(fd); fd = open(device, O_RDWR); if (fd < 0) { perror(device); exit(EXIT_FAILURE); } (void) read(fd, &scrn, 4); (void) lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0); (void) read(fd, &s, 2); ch = s & 0xff; if (attrib & mask) ch |= 0x100; attrib = ((s & ~mask) >> 8); printf("ch='%c' attrib=0x%02x ", ch, attrib); attrib ^= 0x10; (void) lseek(fd, -1, 1); (void) write(fd, &attrib, 1); exit(EXIT_SUCCESS); } SEE ALSO
console(4), tty(4), ttyS(4), gpm(8) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2007-12-17 VCS(4)
All times are GMT -4. The time now is 06:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy