[Solved] putty+x11:How do I pass X11 display rights to "su"?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users [Solved] putty+x11:How do I pass X11 display rights to "su"?
# 1  
Old 01-26-2012
[Solved] putty+x11:How do I pass X11 display rights to "su"?

I can log into a unix system with Putty. I've set the "X11 forwarding" checkbox, and I've verified that I can display an X11 window back on my laptop. What I need to be able to do is "su" to another uid after logging in and then run something which display a window back on my laptop, with the permissions of that su-ed id. That isn't working. I imagine this has something to do with ssh, but I can't figure out the EXACT steps I need to go through to get this to work.
# 2  
Old 01-26-2012
Try the following:

1. Log in to the system, issue the following commands and save their output for further reference:

Code:
echo "$DISPLAY"
xauth list

You will see something similar to this:

Code:
% echo $DISPLAY
localhost:10.0
% xauth list
ubuntu/unix:12  MIT-MAGIC-COOKIE-1  9e7f2b822e5c1cdd96d048adfb870519
ubuntu/unix:11  MIT-MAGIC-COOKIE-1  1eaf535afee8b2de2f0ab9bcab7ef149
ubuntu/unix:10  MIT-MAGIC-COOKIE-1  3bd9602df5fe354c19e39f211ee4668b

Note the value after the semicolon in the DISPLAY value (10 in this case, in red),
note that the last entry is the cookie you're interested in (also in red).
2. Switch the user (su ...), and run the following commands:

Code:
% su -
Password:
~# export DISPLAY=localhost:10.0 # this is the previously saved DISPLAY value
~# xauth add ubuntu/unix:10  MIT-MAGIC-COOKIE-1  3bd9602df5fe354c19e39f211ee4668b # this is the last entry from xauth list output

After this your X session should work.
# 3  
Old 01-26-2012
Outstanding. That fired my long-inactive X11 neurons. It worked fine.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. UNIX Desktop Questions & Answers

X11 Display Problem with Mac OSX after creating new account

For preliminaries, I am on a Mac Pro running 10.5. I am trying to run a program that opens an X11 graphic and plots a mesh. The little program is called showme. It has worked just fine in the past. Up until I had to make a new user account on this machine for myself. Now every time I try to... (8 Replies)
Discussion started by: Bocephus85
8 Replies

3. Linux

Forward X11 Putty+Xming without $HOME

Im trying to forward X11 from new servers by logging with NIS User, but no $HOME is mounted from NIS maps, this is how it was set-up. I got Xming for X11 forwarding which works beautifully with putty, but it aint working with this situation where my $HOME folder is missing, Means when Im logging... (2 Replies)
Discussion started by: kl1ngac1k
2 Replies

4. Solaris

X11 and "Cannot Open Display" errors

Greetings Forumers! I'm posting a solution to an Issue I ran into this week: Getting applications to display on another through X11 and SSH. I have run into this issue many years ago and finally found my notes. Some of you may already know the answer to this issue but it took me a while to... (1 Reply)
Discussion started by: bluescreen
1 Replies

5. Red Hat

INIT: cannot execute "/etc/X11/prefdm"

Hi I tried the following but no joy! Inserted the linux installation cd.. ( rescue mode)... tried chroot /mnt/sysimage but I get chroot: cannot execute /bin/sh Checked the permission on /bin and it was set to ?r--rw-rx tried to do chmod –R 755 but got error operation not permitted ...... (3 Replies)
Discussion started by: halacil
3 Replies

6. Solaris

X11 Display

Hi all, How to setup X11 on Solaris? ~Vinodh' Kumar (1 Reply)
Discussion started by: vino_hymi
1 Replies

7. Solaris

How to set DISPLAY to support X11 window server

I can run xclock from root but not able to run in a user (oracle) I am getting this error during installation of ORACLE-10g (10.2) in Solaris-10 (X86).............when I do ./runInstaller when ever try, getting this error....... DISPLAY not set. Please set the DISPLAY and try again. or... (2 Replies)
Discussion started by: gohappy
2 Replies

8. Windows & DOS: Issues & Discussions

cygwin-x/can't install xorg-x11-f100 & xorg-x11-fnts

Hello All. Really a newbie to Linux/Unix. Trying to get into Linux. Using XP PE currently. Installed cygwin and trying to intall cygwin-x. Everything else is setup nice but i can't seem to install these two packages (without whom xwin won't start) 1. xorg-x11-f100 2. xorg-x11-fnts Tried the... (1 Reply)
Discussion started by: binodbdrchand
1 Replies

9. UNIX for Advanced & Expert Users

pf not working properly even with only "pass in all" and "pass out all" rules

i have two rules in my pf.conf file, "pass in all" and "pass out all" i was having issues with getting pf working to begin with, so i went with starting from nothing and working on up. i have an ultrasparc ultra1 200e, with an added 4-port fast ethernet sbus card, running "3.4 GENERIC#85... (4 Replies)
Discussion started by: xyyz
4 Replies
Login or Register to Ask a Question