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
Usually there is a log entry in /var/log/messages (or similar, depending on your OS) which you could grep with the username.