in reply to Remote HostName using CGI

Information about the client's host is passed to CGI scripts in $ENV{REMOTE_HOST} (the client's host name) and/or $ENV{REMOTE_ADDR} (the client's ip address.) If the server doesn't set $ENV{REMOTE_HOST} it should set $ENV{REMOTE_ADDR}.

Does this answer your question?

In general it is not possible to get the "user name" (i.e. the identity used to log into the client's host) of the client. The concept of a user's identity is something that your application has to create.