Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is there a way to find the Remote Host in ZSH?

["Bart Schaefer"]
>On Jun 29,  5:35pm, Sweth Chandramouli wrote:
>> 	it looks like it; on my machine, at least, i have REMOTE_HOSTNAME
>> and REMOTE_IPADDRESS defined when i log in:
>> (astaroth)~: set | grep 'REMOTE'
>> 	those aren't being set in any of the system-wide scripts or in
>> any of my personal ones, so i'm assuming that they are set by the shell.
>Are they set regardless of whether you rlogin/rsh/telnet/ssh to the remote
>They could be being set by the rlogin daemon or some such, before the shell
>is even started.

As an example, ssh sets SSH_CLIENT='ip.you.are.from srcport localport',
which would be quite adequate for your uses.  As long as you're doing this
for customization, rather then security, it'd work quite nicely to parse
out the IP.

I'd guess that REMOTE_* are being set by some program you're using to
connect.  (Neither rsh, telnet, nor ssh seem to do so on BSDi, so I'm
not sure what you're using.)

I'd tend to hold the login daemon responsible.


Geoff Raye           - geoff@xxxxxxxx          - MEoW!
System Administrator - Neoglyphics Media Corp. - PGP: finger raye@xxxxxxxx

Messages sorted by: Reverse Date, Date, Thread, Author