Topic: Information by a mail about upload files-Script for MySecureShell log
I looking for script who analyze MySecureShell log file and send information by the mail about upload, download files to user... Who help me? I don't have experience in script writing. Thanks.
I enable log file by add line
LogFile /var/log/sftp_server.log
in '/etc/ssh/sftp_config' file.
## MySecureShell Configuration File ##
#Default rules for everybody
<Default>
LogFile /var/log/sftp_server.log
and I have sftp_server.log file
I see information about user and upload, download files
e.g.
2007-11-23 13:10:06 [34:40:1m[18760][tom][192.168.5.22]Upload into file '/In/C070381-ZPA221107.xls.pgp.filepart'[37:40:0m
2007-11-23 13:10:13 [31:40:1m[18760][tom][192.168.5.22]Try to rename '/In/C070381-ZPA221107.xls.pgp.filepart' -> '/In/C070381-ZPA221107.xls.pgp' : success[37:40:0m
I want send information -mail when user about upload files
e.g.
in topic 'MysecureShell user - tom'
and in contents
'Server MySecureShell notify about upload file(s) from user: tom
/home/sftpuser/tom/In/C070381-ZPA221107.xls.pgp
with date 2007-11-23 13:10:13
MySecureShell script'
where home/sftpuser/tom is Home path from /home/sftpuser/$USER in /etc/ssh/sftp_config' file
good information in this mail was be info about size file but i don't see this information in log file
I thinking about change rights and time after file is upload - we eliminate limitation permission and date, when user have own setup client application e.x. WINSCP. Maybe to do from this script level?
Digression:
I use OpenSSH_4.3p2 Debian-9, OpenSSL 0.9.8c and I have another linux server where I don't have install MysecureShell. How setup log file in SSH config? I want see in log file e.g. information about connection and upload files by SSH(SFTP) in syslog like i have in sftp_server.log It's possible without install MysecureShell?
Best regards
onyx