gnurl
asked on
How to run a X-program with sudo using putty and xming?
Hi all,
I do want to run a X-program, lets say xclock, on a linux server. The program should be displayed on a windows pc running xming as X-server.
Or in detail:
1. I logon using putty with X-forwaring as user THEUSER to the server from my pc
2. I start xming as X-server on my pc
3. I run sudo -u THEOTHERUSER /usr/bin/X11/xclock
4. xclock is displayed on my pc ...
The problem is, that there is an error message regarding to the X-settings (DISPLAY)
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
Error: Can't open display: localhost:10.0
I tried to copy the xauth stuff from one user to the other, but the DISPLAY and the cookie change every logon... if the user THEOTHERUSER is offline, there is no xauth information to be copied....
Can give any suggestions?
Thank you very much
Best regards
gnurl
I do want to run a X-program, lets say xclock, on a linux server. The program should be displayed on a windows pc running xming as X-server.
Or in detail:
1. I logon using putty with X-forwaring as user THEUSER to the server from my pc
2. I start xming as X-server on my pc
3. I run sudo -u THEOTHERUSER /usr/bin/X11/xclock
4. xclock is displayed on my pc ...
The problem is, that there is an error message regarding to the X-settings (DISPLAY)
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
Error: Can't open display: localhost:10.0
I tried to copy the xauth stuff from one user to the other, but the DISPLAY and the cookie change every logon... if the user THEOTHERUSER is offline, there is no xauth information to be copied....
Can give any suggestions?
Thank you very much
Best regards
gnurl
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi amrox,
I added the linux server (running xclock) to the windows pc (running xming and sadly NOT displaying xclock). This does not help.
The problem with the display variable is, how do I set this in sudo and start the program I want to run?
For me the problem is following:
1. start Xming (Xming.exe :0 -clipboard -multiwindow) on local pc (to display xclock)
2. start putty on local pc (with X11 forwarding) usind login USER
3. xauth list on remote server shows
<remoteserver>/unix:10 MIT-MAGIC-COOKIE-1 <cookiestring>
echo $DISPLAY on remote server shows
localhost:10.0
4. xclock on remote server starts xclock, and xclock is displayed on local pc using xming
5. starting sudo -u <THEOTHERUSER> /usr/bin/X11/xclock on remote server shows
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
Error: Can't open display: localhost:10.0
6. xauth nextract /home/<THEOTHERUSER>/xauth 1 as user USER
extracts the cookiestring to be merged to THEOTHERUSERs .Xauthority file
7. xauth nmerge xauth1 as user THEOTHERUSER merges the cookie to .Xauthority
so xauth list as user USER and user THEOTHERUSER shows the same cookie
<remoteserver>/unix:10 MIT-MAGIC-COOKIE-1 <cookiestring>
8. adding set DISPLAY=localhost:10.0 to .cshrc for user THEOTHERUSER leads to a DISPLAY
localhost:10.0 everytime the USER logs on.
9. in conclusion:
the xauth information for USER and THEOTHERUSER is the same
the DISPLAY for USER and THEOTHERUSER ist the same
10. but:
sudo -u <THEOTHERUSER> /usr/bin/X11/xclock
throws the same error:
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
Error: Can't open display: localhost:10.0
Does anybody hava any suggestions?
Thank you,
Best Regards
gnurl
I added the linux server (running xclock) to the windows pc (running xming and sadly NOT displaying xclock). This does not help.
The problem with the display variable is, how do I set this in sudo and start the program I want to run?
For me the problem is following:
1. start Xming (Xming.exe :0 -clipboard -multiwindow) on local pc (to display xclock)
2. start putty on local pc (with X11 forwarding) usind login USER
3. xauth list on remote server shows
<remoteserver>/unix:10 MIT-MAGIC-COOKIE-1 <cookiestring>
echo $DISPLAY on remote server shows
localhost:10.0
4. xclock on remote server starts xclock, and xclock is displayed on local pc using xming
5. starting sudo -u <THEOTHERUSER> /usr/bin/X11/xclock on remote server shows
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
Error: Can't open display: localhost:10.0
6. xauth nextract /home/<THEOTHERUSER>/xauth
extracts the cookiestring to be merged to THEOTHERUSERs .Xauthority file
7. xauth nmerge xauth1 as user THEOTHERUSER merges the cookie to .Xauthority
so xauth list as user USER and user THEOTHERUSER shows the same cookie
<remoteserver>/unix:10 MIT-MAGIC-COOKIE-1 <cookiestring>
8. adding set DISPLAY=localhost:10.0 to .cshrc for user THEOTHERUSER leads to a DISPLAY
localhost:10.0 everytime the USER logs on.
9. in conclusion:
the xauth information for USER and THEOTHERUSER is the same
the DISPLAY for USER and THEOTHERUSER ist the same
10. but:
sudo -u <THEOTHERUSER> /usr/bin/X11/xclock
throws the same error:
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
Error: Can't open display: localhost:10.0
Does anybody hava any suggestions?
Thank you,
Best Regards
gnurl
sudo does not work with X11 even on local consoles for most systems.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can find sux in suse 10.
You can find kdesu in kdebase.
Hint: search for respective files in package repository
You can find kdesu in kdebase.
Hint: search for respective files in package repository
My vote: close it in the way that the original poster wanted it closed before the objection. Not sure if that is 1, 2 , 3, or 4 But as the objection is not valid then I vote for the 4 day closure to continue.
Xming running in listen mode on workstation
SSH X11 forwarding enabled in SSH server's /etc/ssh/sshd_config, and sshd reloaded afterwards - kill -HUP `cat /var/run/sshd.pid'
X11 forwarding enabled in putty (default setting)
xdpyinfo should show whats wrong or right with display environment.
If X11 forwarding is disabled on SSH server then it attempts X11 connections to display outside secure channel - bad for firewalled environment.
If no X11 forwarding on client you get error DISPLAY not set.