Discussion Locked

Find IP address a user is logged in from

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am running Red Hat 6.1. I am writing a short script. When this script is run, I would like to know where, as is what IP address, that the user who is logged in and running this script is at. I log in remotely to this machine using an ssh connection. I am not quite sure what commands will give me the info I am looking for. Any help is appreciated.

3 replies

by skizz

You can use w or finger to get details of ip address, cut/awk the required fields. You may also need to use tty to find the line corresponding to the details you require, especially if there are multiple logons

This discussion is closed to new replies.