I have many hosts with dynamic IP addresses that need to be able to access content on a certain local web site at different times that I determine. The times for allowed access are always different. I manage all the hosts that will connect.
When I want a host to be able to access the private web site, I will initiate an SSH tunnel from each host to an account on the web host. Now, the user would be able to access the contents of the web site through http://localhost. When that machine should no longer be able to access the web site, the tunnel will be closed.
On the private web site, I can run PHP scripts/Python/CGI/etc. I need to be able to identify the host that connected because the information that I provide will be different based on the host that connected. If I do a hostname lookup in say, PHP, I, of course, get the hostname of the web server. That will happen for every client connection. I want to be able to access the client hostname. Even worse, the client will have a dynamic hostname. I don't really care about that name. I have a fixed name for each host that is in a file on the system - eg. /etc/fixedhostname.
What information could I store when I create the SSH connection so that from PHP/CGI/Python/etc. I could query the hostname of the connected host.
UPDATE:
Just so there's less mystery to my question... The clients are student machines (run by me) in different computer labs. The web server gives test questions for in lab tests. Different labs may be handling different tests at the same time. I want to come up with a way to figure out the "real" source host (without asking the student). I could pass it in: http://localhost?host=myhost, but then a student in a different test could see the question from another test by just changing the URL. I could encode hostname, then decode it, but the student could still share the URL. Only hosts in test mode would be able to access the web server. Initially, I wanted to do this with OpenVPN, but I figured that creating a CA and managing all the different keys just for the sole purpose of managing access to a web site seemed like overkill, but maybe it's not.. I figured SSH might be easier. I initially figured I might be able to just pass some information in that PHP might be able to access to determine the real identity of the host machine.