Operating System - Tru64 Unix
1748279 Members
4223 Online
108761 Solutions
New Discussion юеВ

redirecting ftp entries.

 
SOLVED
Go to solution
shashang
Occasional Advisor

redirecting ftp entries.

hi all,
Is there any way to log the ftp session entries in the .../syslog.dated/.../daemon.log file in a different file of our choice. If yes then how can it be done?
7 REPLIES 7
Mobeen_1
Esteemed Contributor

Re: redirecting ftp entries.

Shashang,
Are you looking for a solution that will log individual ftp sessions in seperate logs like one ftp log for userA, another for userB and so on.

If this is what you are looking for let me know.

regards
Mobeen
shashang
Occasional Advisor

Re: redirecting ftp entries.

hello Mobeen,
Not exactly. What I am looking for is to log all the ftp entries in a file other then daemon.log, so that it would be easy for me to trim that file as per my needs.
Mobeen_1
Esteemed Contributor

Re: redirecting ftp entries.

Shashang,
Try this and let me know if it works

1. Modify /etc/syslog.conf to add the
line below
local5.info;mail.none /var/adm/syslog/onlyftp.log

2. Restart syslogd to re-read it's config
using the command below

# kill -HUP `cat /var/run/syslog.pid`

Once this is done, make sure that the syslogd is running.

Now all your ftp related logging will be in /var/adm/syslog/onlyftp.log

regards
Mobeen
shashang
Occasional Advisor

Re: redirecting ftp entries.

hi mobeen,
I tried out your instructions. But the ftp entries are not diverted to the onlyftp.log file instead they are still logged in the daemon.log file. The only difference being that now the daemon.log file which previouly used to have other entries, now has only the ftp entries.
So tell me whether those other entries are imp. from the system point of view. If they are not I can run the system with these changes. I am attaching the daemon.log file in the form it was before carrying out the changes.
Mobeen_1
Esteemed Contributor

Re: redirecting ftp entries.

Shashang,
It looks like there is another way, probably better than what i suugested. It involves modifying the inetd, check the link below (especially focus on Alexander's post)

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=214847

Hope this help you

regards
Mobeen
Michael Schulte zur Sur
Honored Contributor
Solution

Re: redirecting ftp entries.

Hi,

so far I couldn't find anything to reroute the ftpd log at the source. Here is an alternative. There is one problem however. Once per day or when tha machine is rebooted, the current dir is switched. You could get ftpd log with grep. Is there any reason, why you want the ftpd log at another place?

hth,

Michael


tail -f /var/adm/syslog.dated/current/daemon.log | while read LINE
do
echo $LINE | grep ftpd >> /dir/ftpd.txt
done

this script is adapted from Bryan Quinn
shashang
Occasional Advisor

Re: redirecting ftp entries.

thanx michael,
i m working fine now

shashang