This question already has an answer here:
I have a machine which is hooked up to a physical display and to which I have ssh & root access, but which does not have a mouse or keyboard. It does not have X installed. I would like to run some commands such that their output is displayed on the physical display.
My thought was that I should just write to /dev/tty1, as I only needed to send keypresses, not receive data. And it worked - kind of. The display is sitting at the login prompt, so running
echo "myusername" | sudo tee /dev/tty1
does in fact cause my username to fill in the field in the physical display! But it never goes to the password prompt...sending newlines does not seem to be the same as a physical press of the enter key. I have tried
echo -ne "\n" | sudo tee /dev/tty1 echo -ne "\r\n" | sudo tee /dev/tty1 echo -ne "\0" | sudo tee /dev/tty1
All just seem to add more blank lines to the username field. Is there a trick?