How to Get Linux Server Sends Email Alert on Root Login Linuxサーバに送信する方法を電子メール警告を取得rootログイン
To improve the security of the server, especially web server which exposes to the Internet and possible worldwide hackers, it’s best to enable server to automatically send a notification email to predefined email address everytime someone logs in as root to the host.は、サーバーのセキュリティを向上させるため、特にWebサーバーを公開し、インターネットや可能性を全世界のハッカー、それを有効にする最高のサーバーに自動的に通知を送信する定義済みの電子メールアドレスにメールをログに記録させるには、 rootとしてのeverytimeをホストします。 To configure the automatic email alert notification to a default email address on each incident of root log on on the server, use the following guide.アラートを設定するに自動送信メールの通知を、デフォルトの電子メールアドレスの各事件のルートサーバー上でログオンし、使用して次のガイドをご覧ください。
- Login to the server via SSH using as root ID. ssh経由でのサーバーにログインしてrootとして番号を使用しています。
- Ensure that you’re at home directory of root.確保することをお詫び申し上げますはホームディレクトリのルートに移動します。 The open up the .bash_profile for editing using pico or vi by typing one of the following commands at command shell line:オープンアップします。 bash_profileにピコやviを使用して編集するには、次のコマンドを入力で1つのコマンドシェルの行:
pico .bash_profileピコです。 bash_profileに
vi .bash_profile Ⅵ 。 bash_profileに - Scroll down to the end of the file and add the following line:下にスクロールして、ファイルの最後に次の行を追加します:
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" user@example.comエコー'警告-r ootシェルアクセス日時: ' `日` ` w ho` |メール-秒"警告: r ootのアクセス権がより` w ho|カット次元" ( " - F 2を|カット次元" ) " - F 1を押して` "ユーザ@ example.comReplace user@email.com with the actual email account address that you want to the root access alert notification been sent to.置き換えるuser@email.comの内の実際のアドレスに電子メールアカウントにアクセスしたいのルートにアラート通知を送信されています。 Note that you can change the text contains in the email alert too.に注意して変更することができますアラートあまりにも、電子メールのテキストが含まれています。 The text starting with first ALERT is written as email body, and you can add in other info such as host name or change the wordings.最初のテキストで始めると警告が書かれていると電子メールの本文、および他のに関する情報を追加することもできますなどのホスト名または変更してwordings 。 The second Alert is the email title which you can change to your own too. 2番目のアラートは、電子メールタイトルを変更することができます自分自身のが判明しました。
Now logout and login again as root, you should receive an email alert at your inbox.今すぐrootとしてログイン再度ログアウトし、お手元に届く電子メールを受信トレイに警告します。 The security trick should works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD and etc.トリックの安全保障に取り組んでは最も人気のフレーバーなどのLinux redhat 、 CentOS版、 ubuntu 、 FreeBSDおよび等
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toを参照してください original English articleオリジナルの英語記事索引 whenever possible.いつ可能です。
Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。
Related Articles関連記事
- Disable Direct Root Login and User Access via SSH to Server rootのログインとユーザーのアクセスを無効に直接サーバーにssh経由で
- Disable and Turn Off Telnet in Linux LinuxのTelnetを無効にしたり、無効にする
- Change and Reset MySQL root Password MySQLのrootのパスワードを変更し、リセット
- Change User Name on Linux Linuxのユーザー名を変更する
- Cannot FTP to Web Host or Server running cPanel/WHM FTPを使用することはできません実行しているサーバーのホストまたはウェブcpanel / whm
- cPanel Invalid License File After Changing Hostname Error cpanel無効なライセンスファイルのホスト名を変更した後エラーが発生
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 FreeBSDの6.0をインストールするWebサーバーのApache 2.2 、 MySQL 5.0以降およびPHP 5 -パート3
- Check and Optimize MySQL Database Automatically with Crontab/Cron MySQLデータベースの最適化を自動的にチェックのcrontab / cronの
- Restore Full Backup or cpmove File in cPanel Web Host完全なファイルをバックアップまたは復元cpanelウェブホストcpmove
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4ウェブサーバーでは、 Windows XPをインストールするのApache2 、 PHP5とmysql4 -パート4

































August 12th, 2007 03:10 2007年8月12日03:10
[...] Linux - wysyłanie maila o logowaniu na konto roota Bardzo użyteczny skrypcik [...] [...]のLinux -m ailaまたはl ogowaniuなw ysyłanieさんr ootab ardzou żytecznys krypcik[ ...]
May 3rd, 2008 05:43 2008年5月3日05:43
‘who -m’ makes the output much cleaner when using this on a system that has multiple users logged on… ' who - M 'のため、出力を使用して、このとき多くて、システム上のクリーナーは、複数のユーザーがログオンして…
-m reports only hostname and user associated with stdin terminal -メートル報告書のホスト名とユーザのみに関連付けられて標準入力端子