Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I programmatically and remotely (using SSH) log-in a user so that the lightdm login screen closes and loads the user's desktop as thought they had physical typed in their username and password?

I have a vanilla Ubuntu 12.04 Desktop setup, and I'd like to be able to start a desktop application remotely via SSH. I've already accomplished this by specifying export DISPLAY=:0, however, the assumes there's already an X-session running.

Edit: I do NOT mean VNC/RDP/Nx. I mean literally logging in the physical terminal, but when you're not at the physical terminal. Imagine someone was sitting down in front of your physical Linux computer, and you want to let them log-in, but you don't want to give them your password. Instead, you SSH into the box, and run a script to log them in and start a desktop session.

share|improve this question
Not quite what was asked but you may be also happy with a VNC solution: – Takkat May 5 '12 at 22:06

Why don't you try a program designed for ssh remote login. Details can be found here:

Just add the program to startup list and give required params.

share|improve this answer
Please see my edit. – Cerin May 5 '12 at 22:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.