LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   TTY echo / redirection / monitor howto (https://www.linuxquestions.org/questions/linux-newbie-8/tty-echo-redirection-monitor-howto-331607/)

rainman4_8 06-08-2005 01:28 PM

TTY echo / redirection / monitor howto
 
Is there a way to view a session of another user logged in via terminal?

eg.

'w' lists current users on pty/0, pty/1, pty/2.

From pty/0 I want to see all commands and output from pty/2.


Thanks.


(I also vaguely recall being able to export the display in X windows to run things under a different user context? Would this be related?)

keefaz 06-09-2005 07:18 AM

You could add these lines in the ~/.bash_profile of the user
(assuming bash is the default shell)
Code:

rm -f /tmp/myoutput > /dev/null 2>&1
mkfifo /tmp/myoutput
script -f /tmp/myoutput

Then after he logged, just type in your terminal :
Code:

cat /tmp/myoutput

ksas025 06-28-2005 01:46 PM

Is there any other way to do this? While this works really good for the monitoring of specific users, many times a who is executed and suspicious terminals are open. I need to know what is going on in that terminal immediately; not next time they login.

Can a terminal be set up to pipe to a FIFO while it is active?


All times are GMT -5. The time now is 04:08 AM.