Configuration proftpd mod_exec与<;IfUser>;
是否有办法仅对某个proftdp用户启用模块“mod_exec” 我已经用--with modules=mod_exec:mod_ifsession编译了proftp,然后以这种方式进行配置Configuration proftpd mod_exec与<;IfUser>;,configuration,proftpd,Configuration,Proftpd,是否有办法仅对某个proftdp用户启用模块“mod_exec” 我已经用--with modules=mod_exec:mod_ifsession编译了proftp,然后以这种方式进行配置 <IfModule mod_exec.c> <IfUser stefano> ExecEngine on ExecLog /opt/proftpd-master/logs/proftpd
<IfModule mod_exec.c>
<IfUser stefano>
ExecEngine on
ExecLog /opt/proftpd-master/logs/proftpd.semics.mod_exec.log
ExecOptions logStderr logStdout
ExecBeforeCommand STOR,RETR /path/to/handler.sh EVENT=BeforeCommand FILE='%f'
ExecOnCommand STOR,RETR /path/to/handler.sh EVENT=OnCommand FILE='%f'
</IfUser>
</IfModule>
启动引擎
ExecLog/opt/proftpd master/logs/proftpd.semics.mod_exec.log
ExecOptions logStderr logStdout
ExecBeforeCommand STOR,RETR/path/to/handler.sh事件=BeforeCommand文件='%f'
ExecOnCommand STOR,RETR/path/to/handler.sh事件=OnCommand文件='%f'
或者这个:
<IfUser stefano>
<IfModule mod_exec.c>
ExecEngine on
ExecLog /opt/proftpd-master/logs/proftpd.semics.mod_exec.log
ExecOptions logStderr logStdout
ExecBeforeCommand STOR,RETR /path/to/handler.sh EVENT=BeforeCommand FILE='%f'
ExecOnCommand STOR,RETR /path/to/handler.sh EVENT=OnCommand FILE='%f'
</IfModule>
</IfUser>
启动引擎
ExecLog/opt/proftpd master/logs/proftpd.semics.mod_exec.log
ExecOptions logStderr logStdout
ExecBeforeCommand STOR,RETR/path/to/handler.sh事件=BeforeCommand文件='%f'
ExecOnCommand STOR,RETR/path/to/handler.sh事件=OnCommand文件='%f'
没有成功。似乎mod_exec只有在条件语句外部配置时才能工作
我的目标是仅为用户“stefano”启用mod_exec,和/或为每个用户配置相应的几个mod_exec配置
有什么建议吗?默认情况下必须启用mod_exec.c,然后可以为不同的用户配置不同的操作:
<IfModule mod_exec.c>
ExecEngine on
ExecLog /opt/proftpd-master/logs/proftpd_mod_exec.log
ExecOptions logStderr logStdout
<IfUser stefano>
ExecBeforeCommand STOR,RETR /path/to/script.sh EVENT=BeforeCommand FILE='%f'
ExecOnCommand STOR,RETR /path/to/script.sh EVENT=OnCommand FILE='%f'
</IfUser>
</IfModule>
启动引擎
ExecLog/opt/proftpd master/logs/proftpd_mod_exec.log
ExecOptions logStderr logStdout
ExecBeforeCommand STOR,RETR/path/to/script.sh事件=BeforeCommand文件='%f'
ExecOnCommand STOR,RETR/path/to/script.sh事件=OnCommand文件='%f'
感谢TJ桑德斯。我希望这有帮助