sftp - how to log file transfers

Just recently I needed to log file transfers using sftp. Here is short description how to achieve it (I am using RedHat/CentOS in my example).Edit file


and change line:

Subsystem       sftp    /usr/libexec/openssh/sftp-server


Subsystem       sftp    /usr/libexec/openssh/sftp-server -l INFO

and then restart ssh service:

service ssh restart

Having that you can watch transfered files in /var/log/messages (they are identified by string "sftp-server"