How to Get Linux Server Sends Email Alert on Root Login Cómo llegar servidor Linux envía un correo electrónico de alerta a raíz Usuario
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. Para mejorar la seguridad del servidor, en especial servidor web que expone a la Internet y los hackers de todo el mundo posible, es mejor permitir que el servidor para enviar automáticamente una notificación por correo electrónico a la dirección de correo electrónico predeterminada cada vez que alguien inicia una sesión en el sistema como root para el anfitrión. 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. Para configurar el correo electrónico automático de notificación de alertas a una dirección de correo electrónico predeterminada en cada incidente de raíz a diario en el servidor, use la siguiente guía.
- Login to the server via SSH using as root ID. Acceso al servidor a través de SSH, utilizando como raíz ID.
- Ensure that you’re at home directory of root. Asegúrese de que usted está en casa de directorio raíz. The open up the .bash_profile for editing using pico or vi by typing one of the following commands at command shell line: La apertura de la. Bash_profile para la edición utilizando pico o vi escribiendo uno de los siguientes comandos en la línea de comandos shell:
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: Desplácese hasta el final del archivo y añada la siguiente línea:
echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" user@example.comecho 'ALERTA - raíz de Acceso a Shell: "` date `` que `| mail-s" Alerta: Acceso a raíz de que `| cut-d" ( "-f2 | cut-d") "-f1` "usuario @ example.comReplace user@email.com with the actual email account address that you want to the root access alert notification been sent to. Sustituir user@email.com con la cuenta de correo electrónico la dirección que desea el acceso de root notificación de alertas sido enviado a. Note that you can change the text contains in the email alert too. Tenga en cuenta que puede cambiar el texto contiene en el mensaje de alerta. 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. El texto comienza con la primera alerta se escribe como órgano de correo electrónico, y usted puede agregar información a otros, como nombre de host o cambiar la redacción. The second Alert is the email title which you can change to your own too. La segunda alerta es el título del mensaje que puede cambiar a su propio también.
Now logout and login again as root, you should receive an email alert at your inbox. Ahora cerrar la sesión y de nuevo el acceso como root, usted debe recibir un aviso por correo electrónico a su bandeja de entrada. The security trick should works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD and etc. El truco debe de seguridad en las obras más populares sabor de Linux, como RedHat, CentOS, Ubuntu, FreeBSD y etc
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Se trata de una máquina que traduzca la página se proporciona "tal cual" sin garantía. Machine translation may be difficult to understand. La traducción automática puede resultar difícil de entender. Please refer to Por favor, consulte original English article artículo original Inglés whenever possible. siempre que sea posible.
Share and contribute or get technical support and help at Compartir y contribuir o recibir apoyo técnico y ayudar a My Digital Life Forums Mi vida digital Foros .
Related Articles Artículos relacionados
- Disable Direct Root Login and User Access via SSH to Server Desactivar raíz de acceso directo y el acceso de los usuarios a través de SSH al servidor
- Disable and Turn Off Telnet in Linux Inhabilitar y desconectar el telnet en linux
- Change and Reset MySQL root Password Cambio y MySQL Restablecer contraseña de root
- Change User Name on Linux Cambio de nombre de usuario en Linux
- Cannot FTP to Web Host or Server running cPanel/WHM No se puede FTP a la web de host o servidor corriendo cPanel / WHM
- cPanel Invalid License File After Changing Hostname Error cPanel archivo de licencia no válida después de cambiar el nombre de host de error
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 Instalación de Web Server en FreeBSD 6,0 con Apache 2,2, 5,0 MySQL y PHP 5 - Parte 3
- Check and Optimize MySQL Database Automatically with Crontab/Cron Comprobar y optimizar automáticamente la base de datos MySQL con crontab / cron
- Restore Full Backup or cpmove File in cPanel Web Host Restaurar copia de seguridad completa o cpmove Archivo en cPanel Web Host
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Instalar Web Server en Windows XP con Apache 2, PHP5 y MySQL4 - Parte 4





August 12th, 2007 03:10 Agosto 12, 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 de Mayo, 2008 05:43
‘who -m’ makes the output much cleaner when using this on a system that has multiple users logged on… 'Que-m' hace que la salida mucho más limpio al utilizar este en un sistema que tiene múltiples usuarios conectados a…
-m reports only hostname and user associated with stdin terminal - m informes sólo el nombre de host y el usuario asociados con stdin terminal