通过以下设置可在用户通过ssh登录时发电邮通知管理员
在 /boot/.bashrc 文件的最后面加入以下代码 [注:.bashrc 是隐藏文件]
echo 'ALERT - Root Shell Access (ServerName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" [email protected]
红字部分请按自己的实际情况修改
通过以下设置可在用户通过ssh登录时发电邮通知管理员
echo 'ALERT - Root Shell Access (ServerName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" [email protected]
红字部分请按自己的实际情况修改