Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Same issue here: only SSH_CLIENT is defined' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Same issue here: only SSH_CLIENT is defined
Authored by: baba on Aug 17, '05 10:18:06PM
This depends on the type of *nix.
I found that our Solaris servers provided neither REMOTEHOST nor any SSH environment variable. *Very annoying*
Try 'printenv' to see what's available, or better:
printenv | sort | more

This may work, too:
SSH_HOST_ADDRESS=`host $HOST | cut -f4 -d" "`
or
SSH_HOST_ADDRESS=`host $HOSTNAME | cut -f4 -d" "`
depending on which (if either) is available.

This is the best hint I've seen in a very long time. I've been making do with BBOpen (using plain ftp and an ssh tunnel) for several years. This is much more sensible. Thanks.

[ Reply to This | # ]
Same issue here: only SSH_CLIENT is defined
Authored by: luomat on Aug 25, '05 08:41:04PM

This is what I use to get REMOTEHOST

REMOTEHOST=`who am i | awk '{print $NF}' | tr -d '(|)'`



[ Reply to This | # ]