We use sshfs in quite a few situations.
We were wondering if there was a way to log the read / writes made to the sshfs mounts we have so we could optimize things on our local side (eg: tweaking cache, locally caching objects, etc).
Any ideas?
We use sshfs in quite a few situations.
We were wondering if there was a way to log the read / writes made to the sshfs mounts we have so we could optimize things on our local side (eg: tweaking cache, locally caching objects, etc).
Any ideas?
sshfs
is a client application, it usessftp
on the server side. Have a look at the manual pages ofsftp-server(8)
andsshd_config(5)
.In
/etc/ssh/sshd_config
, you should put something like (not sure if quotes are needed, try it yourself):This will log details using the AUTH facility (
/var/log/auth.log
on Debian with rsyslogd). To separate SFTP logs from regular authentication messages, you can specify a different facility or redirect the logs. For rsyslogd, you can create/etc/rsyslog.d/sftp.conf
containing:Note that if your sftp user is chrooted, you need to create a
/dev/log
socket such that sftp can send messages to the syslog daemon. For rsyslogd, this can be done by creating thedev
directory and adding the following line tosftp.conf
: