how to logging telnet (-n tracefile)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to logging telnet (-n tracefile)
# 1  
Old 11-03-2010
how to logging telnet (-n tracefile)

Hi,

I need to log telnet sessions. Therefor i want to use telnets logging function.
UNIX man pages - telnet: unixhelp.ed.ac.uk/CGI/man-cgi?telnet
Like:
Code:
telnet -n /path/to/logfile IP PORT

But it doesn't work. The file is created, but it is an emty file after the session.

I've also googled around, but only found the manpages,
but there is no more information.

anyone has a idea?
# 2  
Old 11-03-2010
That is for a tracefile, not logging sessions.
You need to create an interposer process, an alias maybe
This only works for outbound telnet -- not when someone connects to your system.
create a script called /usr/local/bin/telnet that does something like this:
Code:
#!/bin/ksh
umask 000     
[ ! -d tmp/log  ] && mkdir /tmp/log  2>&1> /dev/null
script -a /tmp/telnet.log.$$
/usr/bin/telnet  $*
exit 0

next in /etc/profile
Code:
alias telnet=/usr/bin/local/telnet

Users have to login again to activate this. When a user types "telnet somenode"
the system will telnet to there and record the entire session in a file in /tmp/log

Is this what you mean -- keylogging?
# 3  
Old 11-05-2010
Quote:
This only works for outbound telnet -- not when someone connects to your system.
Thats just what i want. Loging an outgoing telnet session.

So ill try it.

but whats than a tracefile. nothing to do with logging?

---------- Post updated 5th Nov 2010 at 02:07 PM ---------- Previous update was 4th Nov 2010 at 02:46 PM ----------

Quote:
Originally Posted by jim mcnamara
Code:
#!/bin/ksh
umask 000     
[ ! -d tmp/log  ] && mkdir /tmp/log  2>&1> /dev/null
script -a /tmp/telnet.log.$$
/usr/bin/telnet  $*
exit 0

I've tried it without success Smilie
Code:
user@base:~/workspace$ telnet 10.16.1.23 54432
/usr/bin/local/telnet: line 2: syntax error at line 3: `>' unexpected

as i think line 3 only checks if the directory exists
i commented it out and tried again

Code:
user@base:~/workspace$ telnet 10.16.1.23 54432
Script started, file is /tmp/telnet.log.11133
user@base:~/workspace$

So there is no interactive telnet session now.
But the logfile /tmp/telnet.log.11133 is created and emty
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Syslog not logging successful logging while unlocking server's console

When unlocking a Linux server's console there's no event indicating successful logging Is there a way I can fix this ? I have the following in my rsyslog.conf auth.info /var/log/secure authpriv.info /var/log/secure (1 Reply)
Discussion started by: walterthered
1 Replies

2. HP-UX

Logging into UNIX via TCP/IP Telnet

I can connect to the UNIX box using a TCP/IP Telnet session but the UNIX does not respond with the login prompt. The box responds to a PING and the Telnet session actually connects, but no prompt of any sort is recieved back. I can connect via the console, get the login prompt and can login. ... (3 Replies)
Discussion started by: Newnix
3 Replies

3. Solaris

Logging remote telnet sessions via script

Hi, My requirement - for security purpose - I want all root logins to my solaris servers are done by a script kept in a separate unix box. This script will telnet into remote solaris server with root user and log every session via log file. Now my purpose is to log every telnet session... (3 Replies)
Discussion started by: rahul_jain250
3 Replies

4. Solaris

Logging Telnet sessions ?

hello guys, Does anybody know how I can log all the telnet sessions for a specific IP. For instance, anybody who make a telnet to IP x.x.x.x this session will be logged. the purpose of it is that I need to know every command that people are running on this node. Any help ? Thanks. (1 Reply)
Discussion started by: cerioni
1 Replies

5. UNIX for Dummies Questions & Answers

Automatic logging (capture screen output) of telnet/ssh sessions on a Solaris node

Hi I am working in Solaris 10 and I want to monitor logs for every telnet/ssh session that tries to connect to the server. I need these logs to be generated in a file that I can fetch using ftp. I am a new user and a stepwise detail will be great BR saGGee (3 Replies)
Discussion started by: saggee
3 Replies

6. Shell Programming and Scripting

bash telnet session logging

I'm looking at allowing remote telnet into my server. like any security-minded administrator, I want to log what my users type on the telnet session. I'm using the script command to generate transcripts of the users session. I have /etc/profile set to automatically start the script command... (2 Replies)
Discussion started by: ramnet
2 Replies

7. UNIX for Advanced & Expert Users

difference between logging into unix through f-secure ssh client and telnet

hi, what is the difference between logging into unix through f-secure ssh client and telnet is there any more security check is involved can any one explain thanks in advance (1 Reply)
Discussion started by: trichyselva
1 Replies

8. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

9. Solaris

Logging Telnet Sessions

I am trying to find the following information regarding the logging of telnet sessions within a Solaris 10 environment: (1) How can I tell if the logging of telnet sessions is enabled on a Solaris 10 machine? (2) Assuming that the logging of telnet sessions is not enabled, what is the... (1 Reply)
Discussion started by: RobSand
1 Replies

10. UNIX for Dummies Questions & Answers

Logging on via telnet

I have an IBM x330 with RedHat 7.3 that I recently built that appeared to be working fine, but now I appear to have problem connecting via telnet. No matter which machine I try to use( I have tried this with SuSE 8.1 and W2K Pro), I cannot log into my RedHat machine via telnet. I can ping my... (2 Replies)
Discussion started by: Jody
2 Replies
Login or Register to Ask a Question