I have a server running in multi-user mode, which is connected to the keyboard and monitor. On a separate computer, I would like to SSH to the server and run a program that captures keyboard input and prints text on the monitor. The keyboard and monitor will never be used for any other purpose.
Currently, when the server is loading, the input screen (text) is displayed on the monitor. I know that I can write the appropriate device /dev/tty . However, the keyboard is also recorded in the same place.
How can I capture keyboard events and use the monitor as a text display in Linux?
Perhaps I am missing some basics for hardware interoperability in Linux. What do i need to know?
Ending the time for the reward - if someone wants to do this further, I will award accordingly:
I did the following to prevent any login programs from starting:
systemctl mask serial-getty@ttyO0 systemctl mask systemd-logind systemctl mask getty@tty1
Then I run my program when required:
openvt -c 1 -f /path/to/my/program
This will be a completely satisfying solution, except that -f bothers you. What works on tty1 ? Is there anything I can do to stop him? Should I stop him?
It is noteworthy that this solution satisfies all my needs. As far as I understand, I take on tty and get access to its stdin (I get keyboard output) and stdout (print for monitoring).
source share