Tag: press keyboard

Use the keyboard on a remote machine over SSH?

If you use a Linux box to display some infos in a public space , you might not have the possibility to connect a mouse and keyboard every time you need to click on the page.

For example, at work we use a TV to display some metrics with grafana,
Sometime, when we reboot the machine , the identification cookie will be outdated and the browser will land on the authentication page instead.
Since the machine has no keyboard and mousse attached this cause some issues , .
So I’ve used the tool xdotool that allow a privileged ssh user or a script to interact with the mouse and keyboard

An important step is to select the screen on witch you want to send mouses clicks and keystrokes.

After that lets say your screen is displaying a full-screen browser with a login page ,
By default the cursor is already in the login form.

for the example , the login/password are going to be admin/admin

you are now logged and you dashboard will display