How to Get Linux Server Sends Email Alert on Root Login Come arrivare Linux server invia via e-mail a root login
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. Per migliorare la sicurezza dei server, soprattutto server web che espone a Internet e possibile in tutto il mondo hacker, è meglio per consentire al server di inviare automaticamente un messaggio di notifica predefinito per ogni indirizzo di posta elettronica qualcuno log in come root per l'host. 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. Per configurare le email di avviso automatico di notifica a un indirizzo email predefinito su ogni incidente di accesso di root sul server, utilizzare la seguente guida.
- Login to the server via SSH using as root ID. Login al server tramite SSH usando come root ID.
- Ensure that you’re at home directory of root. Garantire che stai a casa directory di root. The open up the .bash_profile for editing using pico or vi by typing one of the following commands at command shell line: Il aprire il. Bash_profile per l'editing utilizzando pico o vi digitando uno dei seguenti comandi di shell a linea di comando:
pico .bash_profile Pico. bash_profile
vi .bash_profile VI. bash_profile - Scroll down to the end of the file and add the following line: Scorri la pagina fino alla fine del file e aggiungere la seguente riga:
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" user@example.comecho 'ALERT - Accesso shell di root su:' `date` `che` | mail-s "Avviso: i privilegi di root che da` | cut-d "("-f2 | cut-d ")"-f1 `" user @ 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 a sostituire l'attuale account di posta elettronica indirizzo che si desidera l'accesso root segnalazione è stata inviata la notifica. Note that you can change the text contains in the email alert too. Si noti che è possibile modificare il testo contiene nella email di avviso troppo. 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. Il testo inizia con prima segnalazione è scritto come e-mail corpo, e si può aggiungere altre informazioni come nome host o modificare le formulazioni. The second Alert is the email title which you can change to your own too. Il secondo avviso è il titolo e-mail che si può cambiare a tuo troppo.
Now logout and login again as root, you should receive an email alert at your inbox. Ora il logout e di nuovo il login come root, si dovrebbe ricevere una notifica via e-mail a vostra casella di posta. The security trick should works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD and etc. La sicurezza dovrebbe trucco funziona sulla maggior parte dei popolari distribuzione di Linux come RedHat, CentOS, Ubuntu, FreeBSD e ecc
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una pagina tradotta macchina che è fornito "così com'è" senza alcuna garanzia. Machine translation may be difficult to understand. Traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale inglese whenever possible. quando possibile.
Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e assistenza in My Digital Life Forums La mia vita digitale Forum .
Related Articles Articoli correlati
- Disable Direct Root Login and User Access via SSH to Server Disabilitare il login root diretto e accesso utente tramite la connessione SSH al server
- Disable and Turn Off Telnet in Linux Disattivare e chiudere telnet in Linux
- Change and Reset MySQL root Password Reset cambiamento e MySQL root Password
- Change User Name on Linux Cambiare il nome utente su Linux
- Cannot FTP to Web Host or Server running cPanel/WHM Non può FTP su Web Host o server che esegue cPanel / WHM
- cPanel Invalid License File After Changing Hostname Error cPanel file di licenza non validi dopo aver cambiato nome host errore
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 L'installazione di server Web in FreeBSD 6,0 con Apache 2,2, 5,0 MySQL e PHP 5 - Parte 3
- Check and Optimize MySQL Database Automatically with Crontab/Cron Controllare e ottimizzare la base di dati di MySQL automaticamente con crontab / cron
- Restore Full Backup or cpmove File in cPanel Web Host Backup completo ripristino o cpmove file in cPanel Web Host
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Installare server Web in Windows XP con Apache2, PHP5 e MySQL4 - Parte 4

































August 12th, 2007 03:10 12 agosto 2007 03:10
[...] Linux - wysyłanie maila o logowaniu na konto roota Bardzo użyteczny skrypcik [...] [...] Linux - wysyłanie maila o logowaniu na konto roota Bardzo użyteczny skrypcik [...]
May 3rd, 2008 05:43 3 maggio 2008 05:43
‘who -m’ makes the output much cleaner when using this on a system that has multiple users logged on… '-Che m' rende l'uscita molto più pulito quando si utilizza questo su un sistema che ha più utenti connessi…
-m reports only hostname and user associated with stdin terminal - m solo rapporti hostname e degli utenti connessi con stdin terminale