DEV Community

Discussion on: Linux terminals, tty, pty and shell

Collapse
 
ultrassak profile image
ultraSsak

Learn something new every day ;)
Thanks for your answer, but it's still not exactly what drills my mind.
This requires the user (first terminal) to do something special before hand, to allow root from second terminal to "spy" on it.
There has to be another way.

Thread Thread
 
napicella profile image
Nicola Apicella

Hi, sure, no problem.

Not sure what you mean by something special.
You can set up tmux to start automatically when ssh ing to the box, for example see this stack overflow answer: stackoverflow.com/a/40192494
The fist user does need to do anything :)

That's one way to tell ssh what to do when you log into the box. I believe you could also change the ssh agent config to achieve the same goal.

Thread Thread
 
ultrassak profile image
ultraSsak

Will look into it soon'ish,
Thanks! :)

Thread Thread
 
napicella profile image
Nicola Apicella

It also looks like you can spoof the tty output by using eBPF, but it basically requires running the program in the kernel. Again, it's not as easy as using tmux XD

github.com/iovisor/bcc/blob/master...