On Sun, 27 Mar 2011 21:38:58 +0800
Marcus <[email protected]> wrote:

> sftp-server logging with chroot in OpenBSD?
> 
> I want to log upload/download information in sftp server

I don't know where is your problem but this is how it works for me ;)

jirib

Match User xxxx
        ChrootDirectory /data/share
        PasswordAuthentication yes
        X11Forwarding no
        AllowTcpForwarding no
        ForceCommand internal-sftp -R -l INFO -f LOCAL0

Match User yyyy
        ChrootDirectory /data/share
        PasswordAuthentication yes
        X11Forwarding no
        AllowTcpForwarding no
        ForceCommand internal-sftp -l INFO -f LOCAL


$ ls
-l /data/share/dev/log srw-rw-rw-  1 root  wheel  0 Mar 26
09:21 /data/share/dev/log=

$ sftp xxxx@localhost
Connected to localhost.
sftp> ls
drupal   ebooks   movies   music    openbsd  upload   video
sftp> quit
                                                                                
                                                                                
                        
$ tail /var/log/xxxx
Dec 22 02:30:39 t400 internal-sftp[24742]: closedir "/disk/0/openbsd"
Dec 22 02:30:41 t400 internal-sftp[24742]: opendir "/disk/1/openbsd/cvs"
Dec 22 02:30:41 t400 internal-sftp[24742]: closedir "/disk/1/openbsd/cvs"
Dec 22 02:30:45 t400 internal-sftp[24742]: opendir "/disk/1/openbsd/cvs/ports"
Dec 22 02:30:45 t400 internal-sftp[24742]: closedir "/disk/1/openbsd/cvs/ports"
Dec 22 02:30:50 t400 internal-sftp[24742]: session closed for local user xxxx 
from [127.0.0.1]
Mar 27 18:52:09 t400 internal-sftp[892]: session opened for local user xxxx 
from [127.0.0.1]
Mar 27 18:52:10 t400 internal-sftp[892]: opendir "/pub"
Mar 27 18:52:10 t400 internal-sftp[892]: closedir "/pub"
Mar 27 18:52:12 t400 internal-sftp[892]: session closed for local user xxxx 
from [127.0.0.1]

Reply via email to