开发者

scp command with alert message

I want to get the alert message for every execution of the scp command. If some one access my file using the scp command, that time I have to receive on开发者_开发问答e mail. How can I achieve this. Please help me.


Unless you have administrative control of the server, what you ask is not possible -- Unix filesystems simply don't work that way. You can set your file permissions so that other users can't find or read your files, but there is no way for you, as an unprivileged user, to request email notification upon attempted or successful access attempts, via scp or any other method.


Are you on the server, or client side?

server side: Key-based ssh authentication has the ability to start custom commands when the user log into the system (can by bypassed if the user can change the authorized_keys file). There you can add a hook to send a mail on the login, or start a own sftp server with the desired logging enabled.


The right way to do that is to replace the scp program on the server by your own version (or by a wrapper).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜