We have a backup application that runs once every 12 hours.
Multiple servers, desktops, and laptops connect to an EC2-instance and push a backup via SFTP using their own log-in credentials.
If they need to recover a file, they can browse files via a simple SFTP-Client and restore their files. This has been running very well for the last 8 months.
I would like to know how many data is transferred on a monthly basis, per user via SSH. I don't need the logs for the past 8 months, but something that would record it starting now would be great.
Is there anything that allows me to do this?
OS: Ubuntu 10.10
It took some awk-magic, this is what my colleague and I where able to put together.
In sshd_config I put this:
Warning: This script hogs memory! If you have large logfiles, it could take up to 10 min for the script to finish (tested on EC2 Micro).
You could track user logons by IP (available in the log files), and then use nearly any traffic monitoring solution (Netflow and IPtraf come to mind) to keep track of the port 22 traffic by that IP.
Unfortunately, historical usage for the previous few months is not available unless you already had something to this effect set up.
You might want to check out this post on sftp logging. I think it will get you what you want, with a bit of additional work to parse the logs.
auditd is a good utility to know what have been done to every file. It might not be what you need tough.