帮助记录 SMB 网络共享活动

帮助记录 SMB 网络共享活动

为了这个问题的目的,我有一个名为server1托管的服务器桑巴舞share1我的本地网络上的网络共享。User1可以通过读写权限访问此共享。

我希望能够以简单、简单的基本格式记录共享中发生的每一点活动。

这是我正在寻找的示例:

[DATESTAMP][TIMESTAMP] User1 accessed share1 from device1
[DATESTAMP][TIMESTAMP] User1 opened folder1
[DATESTAMP][TIMESTAMP] User1 deleted file 'filename'
[DATESTAMP][TIMESTAMP] User1 created folder 'folder2'
[DATESTAMP][TIMESTAMP] User1 created file 'file1'

等等。

以一种非常简单易读的格式记录所有类型的活动,例如文件和文件夹的创建和删除、访问文件和文件夹、重命名、删除、移动、权限更改等(甚至可能是文件的执行)

感谢所有帮助!

答案1

这就是我所做的,这是我能拼凑出的最好的东西。网页搜索于samba vfs extd_audit了解更多详情

将日志级别从 0 调整到更高的数字以满足您的需求

/etc/samba/smb.conf在桑巴服务器上

 [global]
    workgroup = SAMBA
    security = user

    passdb backend = tdbsam

    printing = bsd
    printcap name = /dev/null
    load printers = no
    disable spoolss = yes

    log level = 0 vfs:10

    log file = /var/log/samba/sambavfs.log
    # no log rotation
    max log size = 0

    smb encrypt = required
    client min protocol = SMB3
    client max protocol = SMB3
   #  client ipc signing = mandatory
    client signing = mandatory
    server signing = mandatory
    obey pam restrictions = yes

[data]
    comment = data
    inherit acls = Yes
    read only = No
    path = /data
    directory mask = 770
    create mask = 660
    vfs objects = extd_audit

相关内容