I wanted to be able to login users on their desktop using ssh. I've a lot of clients and I want to log all of them in using ssh from the server. I'm using Ubuntu 14.04. How can this be accomplished?
Edit: in order to clarify a bit more:
Let's say I'm in computer A. I use an ssh connection to computer B. I want to login computer B in such a way that a person sitting behind computer B see the computer logged in as if he himself logged in manually.
I mean, I want to do something so that it'll be exactly as if a user sat behind computer B, entered the password and logged in.
Best Answer
After hours of searching in Google and trying different things I ended up with two ways to do this:
First make your user auto-login by creating file
/etc/lightdm/lightdm.conf
with this content:(for more information How do I enable auto-login in LightDM?)
Then you must restart lightdm using the command:
This results in lightdm logging automatically using your username. Now you can remove the file
/etc/lightdm/lightdm.conf
in order to disable auto-login for your user again.You must first stop lightdm using the command:
then you must use the following command to start an x-session manually:
this command starts a new x-session logged in with your username on tty7, the default tty for lightdm. the
&
sign at the end detaches this process.Note 1: if you receive an error saying
you must edit the file located at
/etc/X11/Xwrapper.config
and setallowed_users
toanybody
. After the start of the x-session you can return it to the previous value(normallyconsole
) for security reasons.Note 2: If your x-session is showing only the desktop and not the unity panels, try removing files
.config
and.cache
located at home folder of your user.If you know any better ways or some improvement you might think is useful please share it here. Thank you.