1837981 Members
1797 Online
110124 Solutions
New Discussion

Re: Telnet loging

 
SOLVED
Go to solution
rvent
Frequent Advisor

Telnet loging

Hello,

I am trying to find a way to log all the telnet connectons made by hostname and save them to a log file /var/adm/teld.log

Is there any way to do that...?

Thanks
7 REPLIES 7
Coolmar
Esteemed Contributor
Solution

Re: Telnet loging

TCP Wrappers will log all of your telnet sessions for you....although they log everthing to the syslog. You can write a script to filter it out to /var/adm/teld.log if you would like.

You can download from here:
http://hpux.cs.utah.edu/

Look for TCP Wrappers 7.6
Calandrello
Trusted Contributor

Re: Telnet loging

friend
execute last -R |more


spex
Honored Contributor

Re: Telnet loging

Hi,

If I understand you correctly, you are interested in logging every telnet session initiated from a certain host. If this is correct, consider creating a wrapper script for the telnet binary. Have the script record its positional parameter, $USER, 'who -u | awk "{print $8}"', etc. in a logfile, and then pass the positional parameters on to telnet. Hide the telnet binary from your users, and then alias the script as 'telnet'.

For extra security:
1) # chmod 550 renamed_telnet
2) Make sure your users aren't a member of the telnet binary's group.
3) Make sure renamed_telnet and telnet_wrapper.sh have the same group.
4) # chmod 2555 telnet_wrapper.sh

PCS
rvent
Frequent Advisor

Re: Telnet loging

Thanks...

This will keep me busy for a bit...
Nate Schuchard
Occasional Advisor

Re: Telnet loging

Hi rvent,

try grep -i telnet /var/adm/syslog/syslog.log.

Nate
rvent
Frequent Advisor

Re: Telnet loging

# grep -i telnet /var/adm/syslog/syslog.log
Nov 27 13:18:40 unix-2 inetd[1242]: telnet/tcp: Added service, server /usr/lbin/telnetd
Nate Schuchard
Occasional Advisor

Re: Telnet loging

Hi rvent,

I must have some service turned on, I have the IP address listed in my output.

Natalie