Re: Detecting whether a session is locally or remotely log ged in
Tony Langdon <[email protected]>
| Newsgroups | gmane.org.user-groups.mlug.main |
|---|---|
| Message-ID | <[email protected]> |
At 12:26 PM 8/26/2005, you wrote: >In those cases, will the DISPLAY value help? I'd have thought you would >be able to tell the difference that way: > :0 = local >localhost:0 = local >foo.domain.com:N = local (regardless of 'N') if machine is really >foo.domain.com > >anything.else.com:N = remote display This may work as a second check after SSH checks are done... >If you're doing X over ssh, then when forwarding X connections, I think >sshd controls which offset to start display numbering, so maybe parse >$DISPLAY & work from there. I'll have to experiment there... :)