I have a script that is to be run by a person that logs in to the server with SSH.
Is there a way to find out automatically what IP address the user is connecting fr
Try the following to get just the IP address:
who am i|awk '{ print $5}'