-->
  • Recent Articles

    OCI: How to Enable X11 Forwarding on an Oracle Linux

     OCI: How to Enable X11 Forwarding on an Oracle Linux 7

    I was configuring one of the Oracle Linux 7 server to install Oracle, which would require the use of an X11 forwarded session, So i need to Configure the X11 forwarding on my server. I'm sharing the Procedure i need to follow to get it done.


    Step 1.  Install the xorg-x11-xauth package (if it is not already installed). For example:

     yum install xorg-x11-xauth

    Step 2:  Enable X11 Fowarding Settings

    This is an option to configure inside your SSHD Deamon settings.

    # vim /etc/ssh/sshd_config

     X11Forwarding yes

    save and exit

    Step 3: Restart SSH Service

    The SSH service should be restarted to apply the change configuration.

     systemctl restart sshd

    Connect From Windows

    1. Connect through Putty or other tool as you like.

    2. Enable X11

    3. Start the session

    Connect From  Linux


     ssh -X root@remote-server

    Bonus Tip:

    If you still can not make the X11 working, then make is to turn off the setting X11UseLocalhost. So part of your configuration would likely look like this:


    X11Forwarding yes
    #X11DisplayOffset 10
    X11UseLocalhost no
    After that restart/reload the SSH daemon.
    # systemctl reload sshd
    # systemctl restart sshd
    


    If you want to X11 forwarding for another user after switch user (su) then please follow the below procedure:

    Say it's working for user1 and you want to use it for user2

    For user1:

    $ xauth list $DISPLAY

    <output1>

    $ echo $DISPLAY

    <outoput2>

    Switch to other user , i.e user2

    $ xauth add <output1> 

    $ export DISPLAY=<output2>

    Try:

    $ xclock

    No comments