| Summary: | OpenSSH should store an SSH_SERVER variable for cluster hosts | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | thomas+openssh | ||||
| Component: | ssh | Assignee: | OpenSSH Bugzilla mailing list <openssh-bugs> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | enhancement | ||||||
| Priority: | P4 | ||||||
| Version: | -current | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
thomas+openssh
2002-08-14 05:41:16 AEST
Created attachment 137 [details]
2 line patch for SSH_SERVER variable with incoming IP & port
This patch adds an SSH_SERVER variable as a counterpart to the existing
SSH_CLIENT variable. Instead of storing the client IP & port, it stores the
server IP and port.
Out of interest why can't you just handle this in /etc/profile or at the system level in general? I don't see this as being all that useful of a feature. - Ben Yes, this patch may seem a bit unusual until you take cluster's into account.This extra
environment, SSH_SERVER is used by /etc/profile. Let me give you a real life example:
Sun 4800 Cluster Node "dirac" has several versions of oracle application server running
on it. Each instance has it's own IP, so it can fail over to other nodes as needed. For
instance, if the load on "dirac" is getting too high, the development instance moves to
"curie". Here are some of the instances on "dirac" in this test case:
OADEV 192.168.100.41
OAPRD 192.168.100.42
OATST 192.168.100.43
TADEV 192.168.100.44
BOPRD 192.168.100.45
When a user SSH's to the hostname "OATST", he lands onto "dirac", because that's the
node where the instance currently is. The /etc/profile script needs to know what IP they
ssh'd into, so it knows how to handle the case. It then processes SSH_SERVER:
if [ "$SSH_SERVER" ]; then
ip=`echo $SSH_SERVER | cut -d" " -f1`
target=$ip
else
and then runs through a case statement (if $target matches 192.168.100.43, we want
OATST's environment) to setup the environment correctly for the OATST instance... to
make it less confusing for the end user, you make the prompt say the instance name
OATST instead of the node name, dirac.
When the user then ssh's to OAPRD in another PuTTY window, they end up on dirac
again, but they don't know that. The environment magically becomes OAPRD, and so
does their prompt.
We've got about 30 cluster instances, of various products, on four Sun 4800 nodes. This
small patch was the only clean way I could figure to discover the IP of the connecting
host. I had thought about a complex loop of lsof's, but it would incur a significant login
delay (at least 15 seconds), and would hang should any nfs resources be unavailable.
I just figured since there is an SSH_CLIENT variable, there should be a matching
SSH_SERVER variable, especially for us folks relying on OpenSSH in HA environments.
add SSH_CONNECTION and deprecate SSH_CLIENT Mass change of RESOLVED bugs to CLOSED |