Re: ssh ip address
Have you taken a look at the environment variables that get set
when you log in over SSH? For me I find I have a variable appropriately
call'd "SSH_CLIENT" that contains the IP address, local port, and remote
port... As simple IP=$(echo ${SSH_CLIENT} | awk '{print $1}') inside
your script should get what you want...
Jeremy
On Tue, Feb 19, 2002 at 05:35:13PM -0300, Eduardo J. Gargiulo wrote:
> Hi all.
>
> Is there any way to obtain the IP address of a ssh client and use it on
> a shell script? I want to put a crontab like
>
> ssh server script
>
> but I need the IP address i'm connecting from in the shell script and
> the address is assigned dynamically.
>
> thanks
>
> ~ejg
>
Reply to: