I have a server running Ubuntu 18.04 which I use with an monitor to display stuff. I don't have a mouse/keyboard connected, only connection per SSH. When the server starts (it runs gnome desktop) I have to login. Is there a way to login per SSH only (not VNC)?
-
Is there any particular reason you don't want to set up automatic login?– vidarloMay 30, 2019 at 19:23
-
I guess that would be the simplest solution... Just thought it would be bad practice and searched for another way.– Pix3lMay 30, 2019 at 19:50
-
I think an important question is why. X in this setup is meant for processing local input if you want X over a network look into XDMCP or VNC depending on your goals. If you're trying to use a remote keyboard and mouse locally then there are options but they take much more then ssh to get running.– coteyrMay 30, 2019 at 19:56
-
@Pix3l if it's bad practice depends on what the machine is used for. If it's a public kiosk or digital signage, it's not a bad practice. If it's an internal workstation where the strategy plans for a fortune 500 company's stored, it's bad practice.– vidarloMay 30, 2019 at 20:05
2 Answers
While I think this sounds a lot like the xy problem, your best bet is to probably disable GUI login, then login to ssh and manually run startx
Unfortunately, this is a bit more complicated and will depend a lot on your setup, but it would work.
To get into a fresh Ubuntu 18.4.2-LTS with putty on a win10 computer I had to install openssh server as there was no ssh daemon listening. (I added myself to the group dialout but that might not be related.) After installing SSH and disabling the firewall I tested the connection and it worked with the username and password given during install. Not with other usernames.