Posts tagged ·

X11Forwarding

·...

X11 forwarding from a remote unix server

Comments Off

Supposed that you are already familiar with how to make X11 forwarding work from your PC to remote AIX server.

1. Make sure you have PuTTY installed on your PC before installing Xming. In your putty config, make sure you enable X11 forwarding in Connection->SSH ->X11.

Putty_x11forwarding

2. Then on your PC run Xlaunch, and make sure to set your DISPLAY to a higher value, for example “10″ and to check “No Access Control”.

Xming_Xlaunch

 

3. Make sure you have X11Forwarding enabled in the sshd config. Your /etc/ssh/sshd_config should contain something like this:

 

X11DisplayOffset 10
X11Forwarding yes
X11UseLocalhost yes
XAuthLocation /usr/bin/X11/xauth

Restart sshd if you have to make the change to /etc/ssh/sshd_config:
stopsrc -s sshd ; startsrc -ssshd

4. Log in to the UNIX host through PuTTY.

Test, run xclock :

# xclock &

The program xclock should open on your window.

5. Now, how do you get around opening an X window if you have to go through a jumpserver first to get to the correct UNIX server, where you would like to start an X-based program? That’s not too difficult also. After logging in on the UNIX jumpserver, following the procedure described above, issue the following command:

# ssh -X -Y -C otherunixhost

Of course, replace “otherunixhost” with the hostname of the UNIX server you’d like to connect to through your jump server. Then, again, to test, run  ”xclock” to test. It should open on your PC. Now you have X11 forwarding from a UNIX server, to a jumpserver, and back to your PC, in fact double X11 forwarding.

Comments Off
June 24, 2011 3:25 pm

Setting up X11forwarding after su – another user id

Comments Off

Problem:

 

I am able to use putty and X11forwarding to establish a Xwindows. however, when I su – into another id, X session broke.

 

Solution:

 

My id is myid and I need to su into wadadm

$ echo $DISPLAY
localhost:10.0

Log on as root in another sesssion:

# cp ~myid/.Xauthority ~wasadm/.Xauthority
# chown wasadm.wasadm ~wasadm/.Xauthority
# chmod 600 ~wasadm/.Xauthority

Back to myid:

myid [testserver] $ su - wasadm

myid [testserver] $ export DISPLAY=localhost:10.0

wasadm [testserver] $ xclock &

We should now see the Xclock is running on your local screen from use id wasadm.

Comments Off
April 1, 2011 11:01 pm

Unable to use the logout command to terminate all processes in a user’s ssh session when exiting.

Comments Off

Technote (FAQ)


Question

Why doesn't the logout command terminate all processes in a user's ssh session?

Answer

You can use the logout command in ssh to terminate processes from a user's ssh session if you

change UseLogin from no to yes in /etc/ssh/sshd_config.

However, if using X11Forwarding in SSH changing UseLogin from no to yes prevents X11Forwarding from working in SSH.

This line should look like the following in /etc/ssh/sshd_config to disable X11Forwarding: #X11Forwarding no

To enable UseLogin in SSH do the following:
# vi /etc/ssh/sshd_config

Change this line from:
#UseLogin no

Change to:
UseLogin yes

Stop and restart sshd.
# stopsrc -g ssh
# startsrc -g ssh

After making the above change when exiting an ssh session using the logout command all processes that were started within the ssh session will be terminated.

For more information on UseLogin and X11Forwarding please see the sshd man pages.


Comments Off