Operating System - HP-UX
1846593 Members
1320 Online
110256 Solutions
New Discussion

Telnet - what IP address was destination

 
SOLVED
Go to solution
Matt Pearse
New Member

Telnet - what IP address was destination

We would like to know what IP address a user telneted to so we can work out what package they are accessing
7 REPLIES 7
hpuxrox
Respected Contributor

Re: Telnet - what IP address was destination

Not completely sure what you are asking but try,

last -R
MANOJ SRIVASTAVA
Honored Contributor
Solution

Re: Telnet - what IP address was destination

Hi Matt

You can possible look at lsof | grep the user name to know which Ip address the user is telnetting . lsof is a freware and works wonders and also ahs both 32 and 64 bit version available . You can look for it at

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/README

for the details.


Manoj Srivastava
hpuxrox
Respected Contributor

Re: Telnet - what IP address was destination

Also try,

netstat -a | grep telnet | grep username
Jeff Schussele
Honored Contributor

Re: Telnet - what IP address was destination

Hi Matt,

You could examine the user's history file - cat or more the file .sh_history in the user's home dir.

Or you could trying logging into this user's account on the system they were telnetting from and enter esc-k to see the last command entered & keep entering k to see previous commands.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mark Greene_1
Honored Contributor

Re: Telnet - what IP address was destination

who -u

HTH
mark
the future will be a lot like now, only later
harry d brown jr
Honored Contributor

Re: Telnet - what IP address was destination

Matt,

Have each user create their own ".sh_history" file, by placing the following into /etc/profile

readonly HISTFILE="${HOME}/.sh_history_`date +%y%m%d.%H%M%S`.$$"
readonly HISTSIZE=50000
export HISTFILE HISTSIZE


Then do this, if their .sh_history's are in /home, otherwise change the /home to either / or the appropriate directory:

find / -type f -name ".sh_history*" -exec grep "telnet " {} \; | sed "s/\0//g" | grep "^telnet " | sort -u


THE "sed" for "\0" (NULL) allow s the further greps to work on SHELL HISTORY files.

live free or die
harry
Live Free or Die
Matt Pearse
New Member

Re: Telnet - what IP address was destination

Thanks to Manoj we have a solution.

lsof gives us the information we require.

Thanks
Matt