人妻丰满熟妇AV无码片,岛国AV无码免费无禁网站,丰满岳乱妇一区二区三区,男插女高潮一区二区

linux ssh 登錄成功后郵件通知

技術(shù)分享 2019-10-01 00:00:00

原理:~/.bashrc 文件為登錄后默認(rèn)自動(dòng)執(zhí)行的腳本。

CentOS

Open the file ~/.bash_profile in a text editor.

Append the following lines:IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"HOSTNAME=$(hostname)NOW=$(date +"%e %b %Y, %a %r")
echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' YOUR_EMAIL_ADDRESS

Ubuntu/Debian
Open the file ~/.bashrc in a text editor.

Append the following lines:
IP="$(echo $SSH_CONNECTION | cut -d " " -f 1)"HOSTNAME=$(hostname)NOW=$(date +"%e %b %Y, %a %r")
echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' YOUR_EMAIL_ADDRESS


可以 發(fā)送到 139郵箱等短信通知郵箱,實(shí)現(xiàn)短信通知功能。
咨詢小瓶科技
咨詢我們
頂部