How to Get Linux Server Sends Email Alert on Root Login Como obter o Linux servidor envia e-mail alerta sobre raiz 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. Para melhorar a segurança do servidor, especialmente servidor web que exponham à Internet e possíveis hackers no mundo inteiro, é melhor para permitir ao servidor automaticamente enviar uma notificação por e-mail ao endereço de e-mail sempre que alguém predefinidos logs em como a raiz de acolhimento. 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 o alerta automático e-mail a notificação de um endereço de e-mail padrão em cada incidente de log a raiz do servidor, utilize o seguinte guia.
- Login to the server via SSH using as root ID. Entrar para o servidor via SSH utilizando como raiz ID.
- Ensure that you’re at home directory of root. Assegurar que você está em casa do diretório raiz. The open up the .bash_profile for editing using pico or vi by typing one of the following commands at command shell line: A abrir o. Bash_profile para edição usando pico ou vi, digitando um dos seguintes comandos no comando shell linha:
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: Role até o final do arquivo e adicione a seguinte linha:
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 - Root Shell Acesso em: "` date `` que `| mail-s" Alerta: Acesso a partir de raiz que `| 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. Substituir user@email.com com o real endereço de e-mail que você deseja acessar a raiz alerta foi enviado a notificação. Note that you can change the text contains in the email alert too. Note que você pode alterar o texto contém no e-mail alerta também. 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. O texto a começar pelo primeiro alerta e-mail está escrito como corpo, e você pode adicionar outras informações, tais como, em nome de host ou alterar o texto. The second Alert is the email title which you can change to your own too. O segundo alerta é o título e-mail que você pode mudar a sua própria também.
Now logout and login again as root, you should receive an email alert at your inbox. Agora logout e login novamente como root, você receberá um e-mail alerta na sua caixa de entrada. The security trick should works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD and etc. A garantia deve truque funciona com sabor mais populares de Linux como a RedHat, CentOS, Ubuntu, FreeBSD e etc
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Esta é uma página traduzida máquina que é fornecida "como está" sem garantia. Machine translation may be difficult to understand. A tradução automática pode ser difícil de compreender. Please refer to Por favor, consulte a original English article Inglês original article whenever possible. sempre que possível.
Share and contribute or get technical support and help at Compartilhe e contribuir ou obter suporte técnico e ajudar a My Digital Life Forums Minha vida digital Fóruns .
Related Articles Artigos relacionados
- Disable Direct Root Login and User Access via SSH to Server Desativar login e direta raiz usuário o acesso via SSH ao servidor
- Disable and Turn Off Telnet in Linux Desativar e desligar o telnet no Linux
- Change and Reset MySQL root Password Mudança e Reset MySQL raiz Senha
- Change User Name on Linux Mudar nome de usuário no Linux
- Cannot FTP to Web Host or Server running cPanel/WHM Não é possível a Web Host ou FTP Server executando cPanel / WHM
- cPanel Invalid License File After Changing Hostname Error cPanel Licença inválida após mudar arquivo host erro
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 Instalando Web Server no FreeBSD 6,0 a 2,2 Apache, MySQL e 5,0 PHP 5 - Parte 3
- Check and Optimize MySQL Database Automatically with Crontab/Cron Verificar e otimizar automaticamente com o banco de dados MySQL crontab / cron
- Restore Full Backup or cpmove File in cPanel Web Host Restaurar backup completo ou cpmove Arquivo em cPanel Web Host
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Instalar Web Server no Windows XP com Apache2, PHP5 e MySQL4 - Parte 4



















August 12th, 2007 03:10 12 de agosto de 2007 03:10
[...] Linux - wysyłanie maila o logowaniu na konto roota Bardzo użyteczny skrypcik [...] [...] Linux - wysyłanie maila o logowaniu nd Konto roota bardzo użyteczny skrypcik [...]
May 3rd, 2008 05:43 3 de maio de 2008 05:43
‘who -m’ makes the output much cleaner when using this on a system that has multiple users logged on… "-M que" a saída torna muito mais limpo quando se usa este em um sistema que tem vários usuários registrada em…
-m reports only hostname and user associated with stdin terminal - m relatórios apenas host e usuário associado com stdin terminal