Enable Logging in the SFTP Subsystem

This is something I have wanted to get working for some time now, and thanks to James P for passing me a note that as of OpenSSH 4.4 you can infact add command line args for the Subsystem configuration, which when combined with the (I assume new) logging functionality of the sftp-service allows you to finally log what is occuring during an sftp session.

Note: Requires OpenSSH >= 4.4

Replace the susbsystem line in your /etc/ssh/sshd_config with

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

Add the following to /etc/syslog.conf

#sftp logging
local5.*                        /var/log/sftpd.log

Restart the sshd and syslog services, try an sftp upload and review the logs @ /var/log/sftpd.log

Comments