SSH X forwarding

记得gentoo需要添加XY

Easy safe way is to use SSH's X forwarding:
ssh -X me@remotemachine

Your display will look to the remote machine like:
echo $DISPLAY
localhost:10.0

Some apps, notably firefox, doesn't get the display from the environment, you have to specify it.
firefox --display=$DISPLAY &

xhost

这个用的不多,大概是需要X client(自己的电脑)和X server (远程的gnome例如),

If you really want xhost /export DISPLAY, I'd advise (and I'm no security guru) to just do this on a local network, not over the internet.

On your local machine:
xhost + remotemachine

On the remote machine:
export DISPLAY=localmachine:0.0

Firefox, etc.:
firefox --display=localmachine:0.0 &

After you're done, remove remote machine access from your xhost:
xhost -