ChanYiuPong
asked on
Get information on user login for linux
I want to check on log-in information, I follow some doc and add the following to the end of
/etc/profle
time=`date +%Y%m%d:%H%M%S`
echo "[$time]: $REMOTEHOST : $USER ." > /tmp/userlogin.log
mail -s "User Login !!" EMAILADDRESS < /tmp/userlogin.log
rm /tmp/userlogin.log
When I received the email, Subject reads OK.
However the body of the email contain only date time and user, the IP address it come from
is missing.
Can anybody lighten me on this ?
/etc/profle
time=`date +%Y%m%d:%H%M%S`
echo "[$time]: $REMOTEHOST : $USER ." > /tmp/userlogin.log
mail -s "User Login !!" EMAILADDRESS < /tmp/userlogin.log
rm /tmp/userlogin.log
When I received the email, Subject reads OK.
However the body of the email contain only date time and user, the IP address it come from
is missing.
Can anybody lighten me on this ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
127.0.0.1 51133 22
127.0.0.1 - client's IP
51133 - client's port number
22 - server's port number
127.0.0.1 - client's IP
51133 - client's port number
22 - server's port number
ASKER
I saw a five digit between IP and port, what is that no ?