1

To better specify my question, I have decided that I want every keystroke to be piped to a package called safecat which uses the maildir algorithm, which is in turn delivering it's output to a remote machine via ssh.

I just feel like when i do mess up, which i will, it would be really cool have that record of exactly what i did on that particular machine to result in such hilarious catastrophe.

If there is a totally different means to achieve the same result, I'm not fussed, but from what i can tell the final keystrokes are difficult to recover.

17
  • 1
    Consider looking at the "script" command, which records terminal sessions. Commented May 9, 2023 at 16:25
  • 1
    Also consider changing you title to something like "How do I pipe my raw keystrokes through a command before sending it through ssh to remote systems" Commented May 9, 2023 at 16:27
  • 2
    it's an all new low for me but I'm going to go ahead and cut and paste that. thanks. Commented May 9, 2023 at 16:32
  • 1
    Welcome to the wacky world of Unix. If you ever get the feeling that it seems like things are coherent, but you can't quite see the pattern, just know: people break the pattern all the time. Your intuition isn't wrong, but it isn't right, either. But the power is so much fun. Commented May 9, 2023 at 16:39
  • 3
    If you want a more exotic solution, have you considered making ~/.bash_history a named pipe and having safecat read from the pipe? And, for the comment from @HackSaw, script may be too noisy. For a simple example, ps -fe is one line with six characters but it produced 887 lines of output on one of my systems. Commented May 9, 2023 at 16:43

1 Answer 1

0

In finding the solution to the missing entries in the bash history file due to having multiple terminals open on this site which i will link when i find it again, but it was to add the following line to the .bashrc file:

export PROMPT_COMMAND="history -a; history -n" 

So I am thinking that appending a command to the list in green that appends a log file and delivers it via scp to a remote machine with an ssh connection with the local should work if my presumption is true, so the keystrokes can be inferred if indeed a completely synchronous appending process occurs throughout your LAN.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.