1827855 Members
1632 Online
109969 Solutions
New Discussion

login monitor script

 
SOLVED
Go to solution
Joseph Bague
Frequent Advisor

login monitor script

I copy a login monitor script from linux which I modify and place it at the end of
/etc/profile. See attach file.

question: is there any command that will give you the remote IP connection?
Expect nothing but ready for everything
4 REPLIES 4
Tom Geudens
Honored Contributor

Re: login monitor script

Hi,
I believe "who -R" can give you the remote server ... from there you can find the IP.

Regards,
Tom
A life ? Cool ! Where can I download one of those from ?
Steve Steel
Honored Contributor

Re: login monitor script

Hi

Try

last -R $(echo $(tty)|sed -e 's:/dev/::')|grep still


Steve steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Darren Prior
Honored Contributor
Solution

Re: login monitor script

who -mR will give you the hostname of the machine the current session has connected from, but you will need to process the line to remove the other info (time, tty, etc.)

regards,

Darren.
Calm down. It's only ones and zeros...
Paula J Frazer-Campbell
Honored Contributor

Re: login monitor script

HI

who -u | awk '{print $1,$8}'


Will pick up logname and ip address

HTH

Paula
If you can spell SysAdmin then you is one - anon