Using a version control system should be mandatory anyways. It does not really matter which one, although I also like git best, the most important thing here is to bring your students to getting used to version control systems. They should embrace them as a normal and invaluably useful thing which can be used not only for programming but also for e.g. managing the work on their next thesis paper.
But anyways, that's not the point in pair programming. The point is to sit next to each other and do the work together, at the same time in the same file. If physically sitting next to each other is not possible that's a pity because I think it cannot be as effective remotely, but well, when this is the constraint in your case, you have to deal with it. Several tools have been named already, but not the most basic one: screen. It is installable in every Linux version I know (and of the BSD's at least on OpenBSD) and simple to use. Just make it setuid root, start it on one of the hosts, enter ctrl-a ":multiuser on" and ctrl-a "acladd " to allow access from another user. Let the other student log in to the machine and execute "screen -x". Now they share a shell and each can see what the other one types. The drawback of course is that they are limited to using old-school text editors like vi or Emacs and no fancy GUI editors. On the other hand this has the advantage that they really learn how to program and not only to click together some pretty looking stuff without having any idea at all how it works.