You can login to a remote computer via XDMCP if it is configured to allow XDMCP logins. I will explain how I did it on two Ubuntu machines running gdm.
Suppose you have two machines A and B ( In my case both are running ubuntu 9.04 , you can try this on other distros too.) They are connected via Ethernet and they are on the same network. (At my end, machine A had an IP address of 10.0.2.2 and machine B had an IP address of 10.0.2.1).
At machine A.
Open a terminal and run
$ sudo gdmsetup
You will get the following screen.
Select Remote tab.
At machine B
Boot the machine and come to login screen. Click on options and select remote login via XDMCP. Wait for a moment you will see machine A in the list.
It is possible to login to remote machines on internet if you have good connectivity. You can add the host IP in the above box and connect to the remote machine to get the login screen.