Is it possible to log a user in a remote computer using ssh?

1

1

I want to connect to a server via ssh and log in (remotely) a user in X11 (gdm).

A little context:
I need to install a wine application in 30 computers, but wine require X11, there is nobody loged there, so wine does not work properly. I want to remotely login in display=:0.0 a user so this user receive the window (it only start and close), there i need to ()neThere is no one logged on there. I need to start a graphical app there (wine installer) but I cannot because it needs a display with X11 (to open a wineconsole).

Resumen:
Is it posible to log a user remotely on X11

My config: every computer have fedora 10 and gnome.


Clarification:
I do not want to do X-forwarding, I want to show the window on the remote computer, not mine. I want to log the user on the remote computer. If I go (fisicali) to the computer, the user should be logged on.


Update: I asked to gdm developers, but I had no answers... I'm starting to think there is no way. The only option I can think is to config autologin, restart gdm, and get the config normal again (all by script) But I have to read a lot for that and is not so important, I prefer to log in manualy 30 times.

eloyesp

Posted 2010-06-09T22:00:25.167

Reputation: 403

You'd probably have to kill gdm and fire up an X server on the remote machine. Either gdm owns the display or will fight you constantly for it. – msw – 2010-06-09T22:33:31.013

If I kill gdm it restart automaticaly... and how I do that (without gdm and with a logged user)? – eloyesp – 2010-06-09T22:57:33.920

ockquote>

I want to show the window on the remote computer, not mine There is no reason to want that. You can log in remotely while displaying locally, this is what the answers are driving at.

– Tobu – 2010-06-11T12:36:39.680

Answers

2

I don't believe it's possible to remotely control GDM on the console. Gnome's builtin VNC server (vino) doesn't start until the user logs in, so it doesn't run with GDM. There are ways to get GDM on a VNC server, but those will be separate displays from the console.

You've already identified the alternative: script setting GDM to autologin, then restart GDM, then perform your installation, then reset the GDM settings to undo the autologin, then restart GDM again.

  • restart GDM:
    • on Ubuntu or other systems with Upstart-enabled GDM, run initctl restart gdm
    • on SysV-init systems, run /etc/init.d/gdm restart
    • don't forget sudo or su if needed

  • GDM autologin: add these lines to the [daemon] section of your /etc/gdm/custom.conf or /etc/gdm/gdm.conf (depending on your distribution). username cannot be root.

    AutomaticLoginEnable=true
    AutomaticLogin=username
    

quack quixote

Posted 2010-06-09T22:00:25.167

Reputation: 37 382

1

You can do this using vnc. You can also tunnel it through your ssh session.

http://www.vanemery.com/Linux/VNC/vnc-over-ssh.html

user4892

Posted 2010-06-09T22:00:25.167

Reputation: 196

Yes, I can, but I want to use the console, and if possible not to type password (I am logged as root on the remote computer). – eloyesp – 2010-06-10T13:07:12.517

0

Have a look at NoMachine NX (www.nomachine.com). It works over ssh but speed on slow connections is much better than plain old x-forwarding and you don't lose the x session if the network goes down. You can connect to the remote machine, run your app and then "disconnect" thus leaving the x session active. On the next reconnect you are prompted if you want to reconnect to the currently active session. There is also a completely free clone/fork/whatsoever called freeNX, but I've never tried it.

user16115

Posted 2010-06-09T22:00:25.167

Reputation:

0

Assuming there's nobody using the display on the remote computer, why can't you simply log in remotely, set the display var, and start your program?

chris

Posted 2010-06-09T22:00:25.167

Reputation: 8 607

I get an error (cannot open display)... – eloyesp – 2010-06-09T23:01:15.457

Sounds like someone else is logged in. – chris – 2010-06-10T11:58:27.500

I think that gdm is logged in only, there is no one else. – eloyesp – 2010-06-11T12:25:01.177

0

As I see there is no such option in gdm, and is possible the workaround of quack quixote, but it is possible to do it in kdm: using sockets

eloyesp

Posted 2010-06-09T22:00:25.167

Reputation: 403

0

You should be able to start a second X server on a different virtual terminal, and set the DISPLAY variable to point at it. The xinit or startx utilities are probably the easiest way of doing this, and man Xorg will tell you what server arguments to use (eg vt08 and :1). You will probably need to use sudo to run it. The xinit man page has some examples that may be useful.

Neil Mayhew

Posted 2010-06-09T22:00:25.167

Reputation: 776

yes, this sound no easy, but could help to install software while other user is using the computer. Now I preffer using autologin... – eloyesp – 2010-07-09T19:57:37.093

Actually, the second virtual terminal would be displayed on the screen, so someone sitting at the computer would see your install and would have their work interrupted. The only benefit would be a more controlled environment, ie not having all of GNOME or KDE running, just whatever you choose to run, which would be the program running under WINE and maybe a lightweight window manager like metacity. – Neil Mayhew – 2010-07-11T00:29:40.287