SSH_CLIENT _not_ set when doing a command
Markus Friedl
markus.friedl at informatik.uni-erlangen.de
Mon Sep 25 04:31:04 EST 2000
hi, i cannot reproduce this:
folly% cat bin/echoclient
#!/bin/sh
env|grep SSH
folly% grep bin/echoclient .ssh/authorized_keys2
command="/home/markus/bin/echoclient",from="::1" ssh-dss AAAAB3NzaC1kc3MAAACBAKJzhwF2Xh7WhRsrid6Ha8iWhlsiV9FfXnLlnoOHhyibTtKwkCp7BaryJIZtPGKrICFRmev1Iyvo7gbHWbcBBOtLcikxa5Nta3SgrS5ZidxpgVlkXBUAJ9l8BuMXuvzVnphZcaHOrymaEH9No6Mik1VTBNBjMvr+cqJXGMewIv5RAAAAFQD8TaAd/JFQ88M/XMiUKMguRNQ+CQAAAIAWFPia8OHjuSgQk46eag9vgQKeU8GsxYbDWc5gn237XjZyehgbE7e81BbJ29qV5fUchHw8AUTavudhiS3urFPL9EbThVKQtXQxdb4Pzy2shqII49Hhu+ge60d8OoFL3mnkQ0GaiZZozxICWlYyGc1AuLDcynbqTHHLcV5zpGVG/wAAAIAd6id68R4fQrRT+ghS308pYj0xWppdRZdD8OfZBUIK80wMWtn5r8htwBu1qLVU2wTANU+lopRSDZBuSOxku3nzETCwUqBbYRFOQh9R0TPgyxzsnqGrdp6ul5NB0YoowYlr6O9ftDvMHj8rDmwEY/Bsiv2XASac5W9wG6jTjWe/QA== markus at folly
folly% ssh ::1
SSH_CLIENT=::1 43697 22
SSH_TTY=/dev/ttyp9
Connection to ::1 closed.
folly%
so it works fine.
On Sun, Sep 24, 2000 at 02:47:36PM +0200, Sendy wrote:
> Hi,
>
> I'm trying to create an dynamic dns system by using the nsupdate (or Net::DNS) trough a non-passphrase protected ssh session. I've keygen'ed an extra key, with no passphrase and using it, i execute a litte script on the server, which updates te DNS records. (something like this: ssh pickup /usr/local/bin/updatedns 10.1.2.3)
>
> This al works fine and dandy. I would like to protect this scheme more by using the command="<command>" feature, the only problem is that i can't use an ip-number in authorized_keys (because i do not know it).
>
> In an interactive shell, the env variable 'SSH_CLIENT' is set, and this variable can easily be parsed for the connecting ipnumber. The real problem is that this variable is _not_ set when just executing a remote command.
>
> Is it possible to retrieve the ipnumber of the connecting client while executing a remote command? Simply turning on the enviroment variables should suffice.
>
> im using OpenSSH version 2.2.0p1 on Debian GNU.
>
> gr,
> Sendy De Graaf
> sendy at dds.nl
>
More information about the openssh-unix-dev
mailing list