0
Is there any way to do that? Provided I have ssh access to a machine and I have root on the machine. Can I run xclock for instance in the currently running X (xfce or gnome) session?
0
Is there any way to do that? Provided I have ssh access to a machine and I have root on the machine. Can I run xclock for instance in the currently running X (xfce or gnome) session?
3
You would need to have their xauth token added to your authorization file, and set your DISPLAY accordingly.
First set the DISPLAY variable to the proper X display, since it's the local display it is probably just :0.0 so:
$ export DISPLAY=:0.0
Then import the user's xauth token into yours:
$ xauth merge ~user/.Xauthority
Once you have done that you should be able to run an X client and it will show up on the correct display:
$ xclock &
If your userid has access to the user's ~/.Xauthority then you can do this without being root. But the default permissions for the ~/.Xauthority file is 0600 so likely you'll need to do all this as root.
Hope this helps.
Or the user allows him to open programms in his session. Which is answered here. Is it possible to merge both questions. Because the later one describes it more clearly or should it be tagged as duplicate instead?
– wottis – 2013-06-04T21:23:40.413
1You'll need
xforwarding
enabled in the/etc/ssh/sshd_config
(if I recall) and to launch the ssh session withssh -X user@host
. Then you can callxclock &
, though it may take a sec to launch. – nerdwaller – 2013-06-02T20:32:19.283Like @nerwaller wrote you'll need X11 forwarding. How to use it is described in more detail here.
– wottis – 2013-06-02T22:08:11.300That is actually something different. I need to run the
xclock
not in my X session (X forwarding), but in the X session that is actually running on the remote machine. To make it simple, I just want to open a browser (for instance) to the person, who is actually operating with the PC I have access and root to. – user1594980 – 2013-06-03T14:49:16.173