- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ftp logging per user
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2002 06:54 AM
12-03-2002 06:54 AM
I need to log all of the users ftp session activities in seperate files (i mean one log file for one session)...
any great ideas?
thx...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2002 06:57 AM
12-03-2002 06:57 AM
Re: ftp logging per user
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x977985079106d71190050090279cd0f9,00.html
http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000062909947
Regards,
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2002 07:06 AM
12-03-2002 07:06 AM
Re: ftp logging per user
i have ftp debugging and logging enabled at the top level,
so i have a file with all the session activities are logged in...but what about to log in seperate files...
maybe we have to write a script that reads line by line the ftp log and then do some magic,
but is there an easier way?
thx...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2002 09:34 AM
12-03-2002 09:34 AM
Re: ftp logging per user
Have you specified the -L option for ftpd in inetd.conf?
This won't put it int a special, by-user file, but at least all commands will be logged into syslog.log
Hope this helps
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2002 11:09 PM
12-03-2002 11:09 PM
Re: ftp logging per user
i have all the ftp activities logged in one file,
but i need to seperate it...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2002 01:17 AM
12-04-2002 01:17 AM
Re: ftp logging per user
cat /var/adm/syslog/syslog.log | grep ftpd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2002 01:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2002 11:33 AM
12-04-2002 11:33 AM
Re: ftp logging per user
The following sample code will do what you want. and works One my ftp server.
Assumptions:
I am using HPUX 11.00
the ftpd is set to log into syslog.log.
#Make a directory to put files And cd there
# you should improve this logic to match your needs
DIR=/tmp/ftp$$
mkdir ${DIR}
cd ${DIR}
# grep ftpd related activity from syslog.
# sort the results so the pids are in order as opposed to timestamp
#Awk out and append users related stuff.
grep -e "ftpd\[" /var/adm/syslog/syslog.log |
sort +17 |
awk ' BEGIN {FS = ","; OFS = ",";}
{
if ( $0 ~ /FTP LOGIN FROM/) { USER=$2
gsub(/ /,"", USER)}
printf("%s\n ",$0) >>USER
} '
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 02:49 AM
12-11-2002 02:49 AM
Re: ftp logging per user
here is what i did:
1) install&compile tcp-wrapper
2) edit inetd.conf:
/ftp/tcp_wrappers_7.6/tcpd /usr/sbin/ftpd [options]...
3) HUP it
4) edit hosts.allow :
# more hosts.allow
ftpd: ALL: (/home/volkan/ftplogger %p) &
5) and here's is the prototype of the code:
me=$$
ftp_proc=$1
tail -1f /var/adm/syslog/syslog.log | while read line;do
echo $line | grep -q $ftp_proc
if [ $? -eq 0 ]
then
echo $line | grep -q 'FTP LOGIN'
if [ $? -eq 0 ]
then
user_name=`echo $line | awk '{print $10}'`
fi
echo $line | grep -Eq 'lost connection|timed out|Goodbye.'
if [ $? -eq 0 ]
then
echo $line >> /home/volkan/tmp/${ftp_proc}.ftplog.tmp
mv /home/volkan/tmp/${ftp_proc}.ftplog.tmp /home/volkan/logs/${user_name:-"unknown"}.${ftp_proc}.ftplog.`date +"%Y-%m-%d"`
kill -9 `ps -ef | grep $me | grep -v grep | grep -v ftplogger | awk '{print $2}'`
exit
else
echo $line >> /home/volkan/tmp/${ftp_proc}.ftplog.tmp
fi
fi
done
6) by the way, this is not an hp-ux box, as i have no
UX test box :(, i need to see it in the production env..
thx all...
any easier ways are welcome...
regards...