About Me

Anjum Ara I am a technology enthusiast, an ardent reader. My latest interest is virtualization. In my free time, I love understanding child nutrition, child holistic development. I bake, read, paint, and do whatever it takes to improve myself every day.

Sunday, August 4, 2013

xhost command in Linux

xhost 

Description
       The xhost program is used to add and delete host names or user names to
       the list allowed to make connections to the X server.  In the  case  of
       hosts,  this  provides  a rudimentary form of privacy control and secu-
       rity.  It is only sufficient for a workstation (single  user)  environ-
       ment,  although  it  does  limit  the worst abuses.  Environments which
       require more sophisticated measures  should  implement  the  user-based
       mechanism  or use the hooks in the protocol for passing other authenti-
       cation data to the server.
Learning
     Assuming we have two hosts one 'local host' and the other where connection is being established as 'remote host'  . Giving xhost + <hostname> gives permission to which host(s) should be able to establish a connection with the localhost.

Typical usage with VNC. 
     On remote host:
                                vncserver 
    Enter the password and end result is obtained as <hostname>:<display#>

  Download vncviewer clients like TightVNC, Run VNC.
connect as <hostname/ipaddress>:<display#> enter the password that was provided and the connection is established.

Now on vncserver enter xhost + or xhost + `hostname`
set display 
                  export DISPLAY=:<display#> or
                  export DISPLAY=<hostname>:<display#>

Then type
                               xclock

to validate if clock is shown and display is set right.

This is a non secure way of working but a secure connection can be established via tunneling.



Can learn about usage by using man xhost on linux/unix systems.




Share:

2 comments:

disha said...

Hey Anjum,

Good work

-Disha

Anjum Ara said...

Hey Disha,
Thanks, Need to keep posting more to learn more.