Remote login with graphical display manager (GDM, LightDM)

59,585

Solution 1

Install x11vnc on the remote

We assume a working ssh setup has already been done.

user@remote: sudo apt-get install x11vnc

Remote login with GDM

We assume that a successful vnc setup has already been done.

user@remote:~$ sudo x11vnc <options>

x11vnc will use our predefinded VNC settings and passwords. For further options see the manpage and this nice and elaborate tutorial.

Remote login with Light DM

To access the Light DM login screen we need to submit the Xauhority file for Light DM

ssh user@remote
user@remote: sudo su
root@remote: x11vnc -auth /var/lib/lightdm/.Xauthority -display :0

View the remote screen

On the client side launch the vncviewer (e.g. from xtightvncviewer as follows:

vncviewer -via user@remote localhost:0

By localhost:0 we display screen 0 on the localhost. The option -via is for using ssh.

After typing in the password for the remote login we can proceed with the graphical login.

Solution 2

FreeNX. You log in graphically - same as sitting in front of computer. All of it happens tunneled though SSH. You'll love it.

Share:
59,585

Related videos on Youtube

luri
Author by

luri

Working fields: Architecture and structural engineering Graphical design Research on architecture Teaching (maths, design, technology, visual arts...)

Updated on September 17, 2022

Comments

  • luri
    luri over 1 year

    Is it possible to remotely (via ssh) make a login to GDM? I'll explain a situation in which I'd need this: I'm on my laptop and connect to my desktop via ssh. I realize there are some updates available. I install them all, but I need to reboot the computer. The problem is that once the desktop has rebooted, there will be no GDM session available, since it's necessary to log in. Can I somehow perform the GDM login remotely from my laptop?

    Edit: I can't find FreeNX for Maverick, and I haven't been able to configure x11vnc + vncviewer to work. Isn't there an easy way?

  • luri
    luri over 13 years
    Exactly what should I do in the remote machine, and what in the local machine... Additionaly... would that run over shh (encrypted and such)?
  • luri
    luri over 13 years
    Got to test both x11vnc and FreeNX... I'm quite concerned about security, tho, so I'd like to know which one is the safest.
  • richardwiden
    richardwiden over 13 years
    They both forward though SSH.
  • luri
    luri about 13 years
    I'll have to install and configure vnc first... So it'll take some time to test both x11vnc and FreeNX (lil time to test... kids, also :) )
  • luri
    luri about 13 years
    When I issue x11vnc command on the remote machine, I get a dramatic warning about not having set a password and about everyone being able to see my desktop.... How do I set a password? Do I really have to set up one?
  • luri
    luri about 13 years
    Oh, and actually sudo x11vnc fails to start... says it can't find display
  • luri
    luri about 13 years
    I just can't find FreeNX... It's not in the default repositories, and their ppa returns a couple of 404-type errors (i'm using maverick, btw)
  • luri
    luri about 13 years
    What do you mean? I installed x11vnc on the remote machine, and xnc4viewer on the local one. I have an additional problem with the vncviewer command: I'm not using public keys, but password instead, and my ssh server does not run on port 22 (default).
  • richardwiden
    richardwiden about 13 years
    The commercial (free) edition is available. nomachine.com/download.php
  • luri
    luri about 13 years
    I reinstalled and it worked (?).... Some misconfiguration. I need to check wether it's running over ssh right now (I don't really think so, at least the way you have told me to start both server and client sides). So I need to redirect ports on ssh'ing or something. I'll check and post the solution I found (if any) here as a comment. Anyway, you pointed the way to go, so the accepted answer is yours.
  • luri
    luri about 13 years
    Oh, a first comment would be (I'd suggest you add it to your answer) is that I had to issue x11vnc -auth guess -display :0 as root when I wasn't logged into GDM on the remote machine.
  • Takkat
    Takkat about 13 years
    @luri: I do hope yout got it running finally - thx for accepting :). Config options are very system dependent, I therefore edited my answer for references to options but need to keep it rather general for others (too many options depend on individual system settings). I'll delete my previous comments to reduce clutter ;)
  • luri
    luri about 13 years
    You're right... a wide-range answer can be better. Yep, I got it running. Quite a lot of mess with ports and such. I used vncviewer from xvnc4viewer package, and SSVNC (which I liked most, because even though it is a bit more difficult to configure, it makes the SSH tunneling and VNC viewing on a single shot).
  • rickfoosusa
    rickfoosusa over 8 years
    The x11vnc package with remote access using tightvnc just worked perfectly for me on Ubuntu 15.04. The vino for the user desktop was on port 5901 instead of 5900. The unsecured X11 connection shut down when I logged out. perfect.
  • b_laoshi
    b_laoshi over 3 years
    This does not work with Wayland which Ubuntu seems to have switched over to recently.
  • Takkat
    Takkat over 3 years
    @b_laoshi: yeah - you need to run Xserver for X applications to work. See askubuntu.com/questions/961304/… and possibly also relevant: askubuntu.com/questions/1286646/…