4

I am searching for a way to interact with a local console via SSH - just as you would do with an directly connected keyboard.

In my particular case I got a debian server (console only, no X system) which displays several textual values on tty1. There are not input devices attached to this computer, just a single display. The configuration is done over ssh. Commands executed in SSH should show up on tty1.

Is there a way to interact with tty1 in the same manner as a VNC session would do on a X-Window system?

3 Answers 3

7

You can read the text currently displayed on the screen from /dev/vcs. If your terminal window has the same number of columns as the actual screen output on the server, then you can simply type cat /dev/vcs and get a recognizable output.

You can append a number to access a specific console rather than always the active console. And you can use vcsa, if you want formatting information as well. So for example you can use /dev/vcsa1 to get the text on the first VC a long with formatting information.

Producing keyboard input is another matter. AFAIR the calls used by gpm only supports cut-n-paste, and doesn't allow arbitrary keystrokes to be input. A few searches on the net suggested it isn't supported out of the box, but it is possible to implement as a driver.

4

If it's an actual server, it will have out of band management (IPMI) features which will allow you to access the system console. For instance Dell servers call it iDRAC, HP servers have iLO, etc.

If your server has no such functionality then you can connect an IP KVM device to it.

2
  • Theres no real server hardware used. I am searching for a pure software solution without additional hardware: As I said in the question: some kind of "vnc" but without the need to run an X system.
    – gorootde
    Jul 1, 2014 at 13:40
  • 1
    Well, those are your options. They all involve hardware. You'll probably find a unicorn before anything else. Jul 1, 2014 at 14:06
4

I know this is an old question, but here's some insights :

  • Using "screen" is the way to go

  • start by typing screen

  • type your command

  • press CTRL+A d (to exit the screen)

  • this will detach the screen from your current session.

  • once you log back to your server, you can type : screen -ls to see the list of active screens

  • reattach the screen by using the command : screen -r <id of the screen>

1
  • This is not what the OP asked for, but unless they have some strange use case for the actual console, this is what they need. Mar 29, 2022 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .