How to Get Linux Server Sends Email Alert on Root Login Ako sa k nám Linux Server Odošle Email Alert na Root Prihlásiť

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. K zlepšeniu bezpečnosti na server, web server, ktorý najmä vystavuje na internete a možno na celom svete hackermi, je to najlepšie k tomu, aby server automaticky odoslať email s oznámením na preddefinované e-mailovej adresy vždy niekto prihlási ako root na hostiteľa. 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. Ak chcete nastaviť automatický email záznamu oznámenia na predvolený e-mailovú adresu, na každý incident zo root prihlásite na server, použite nasledujúci návod.

  1. Login to the server via SSH using as root ID. Prihlásiť sa k serveru cez SSH s použitím ako root ID.
  2. Ensure that you're at home directory of root. Zabezpečiť, že máte doma v koreňovom adresári. The open up the .bash_profile for editing using pico or vi by typing one of the following commands at command shell line: K otvoreniu. Bash_profile editace pomocou pico vi alebo zadaním jednej z nasledujúcich príkazov na príkazový riadok shellu:

    pico .bash_profile pico. bash_profile
    vi .bash_profile vi. bash_profile

  3. Scroll down to the end of the file and add the following line: Prejdite na koniec súboru pridajte nasledujúci riadok:


    echo 'ALERT - Root Shell Access on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" user@example.com

    Replace user@email.com with the actual email account address that you want to the root access alert notification been sent to. Nahradiť user@email.com s aktuálne e-mailovú adresu účtu, ktorý chcete koreňové prístup záznam oznámenie bolo odoslané. Note that you can change the text contains in the email alert too. Všimnite si, že môžete meniť text obsahuje v e-mailu varovania príliš. 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. Text začínajúci na prvý záznam je zapísaný ako text e-mailu, a môžete pridať ďalšie informácie, napríklad názov hostiteľa alebo zmenu formulácie. The second Alert is the email title which you can change to your own too. Druhý Alert je email titul, ktorý si môžete zmeniť na svoje vlastné moc.

Now logout and login again as root, you should receive an email alert at your inbox. Teraz odhlásiť a znovu prihlásiť ako root, mali by ste dostať e-mailové upozornenia na svojej e-mailovej schránky. The security trick should works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD and etc. Zábezpeka by trik funguje na najpopulárnejšie varianta pre Linux, ako je RedHat, CentOS, Ubuntu, FreeBSD atď

IMPORTANT : The page is machine translated and provided "as is" without warranty. Upozornenie: Stránka je stroje preložené a poskytované "tak ako sú" bez záruky. Machine translation may be difficult to understand. Strojový preklad môže byť ťažké pochopiť. Please refer to Obráťte sa prosím na original English article Anglický originál článku whenever possible. kedykoľvek je to možné.


4 Responses to “How to Get Linux Server Sends Email Alert on Root Login” 4 Reakcia na "Ako sa k nám Linux Server Odošle Email Alert na Root Prihlásiť"

  1. dean dekan
    November 21st, 2008 03:41 21. november 2008 03:41
    4 4

    Great stuff, Great stuff,

    Is there a way to have the IP of the person who logs in show up? Existuje spôsob, ako mať IP adresu osoby, ktorí sa prihlási až v show?

  2. Emilio Emilio
    November 1st, 2008 03:06 1. novembra 2008 03:06
    3 3

    This works for root login or su – from a user login. Táto práca pre root prihlásiť alebo nie - od užívateľa prihlásení.
    How can I implement it that will work also for “su” only? Ako môžem implementovat to, že bude fungovať aj pre "nie" len? Right now since the path will change with su instead of su – it will not send an email if someone is not using the “-” after the su. Práve teraz, pretože cesta sa bude meniť v su namiesto su - nebudeme posielať e-mailom, ak niekto nie je pomocou "-" po su. Thanks. Vďaka.

  3. Jon Jon
    May 3rd, 2008 05:43 3. máj 2008 05:43
    2 2

    'who -m' makes the output much cleaner when using this on a system that has multiple users logged on… ', Ktorí-m' je oveľa čistejšie produkcie pri použití na systéme, ktorý má viac užívateľov prihlásený ...

    -m reports only hostname and user associated with stdin terminal -m správy iba používateľské meno a spojené s stdin terminálu

  4. Linux - wysyłanie maila o logowaniu na konto roota « Barni.LOG Linux - wysyłanie maila o Logowanie na konto roota «Barni.LOG
    August 12th, 2007 03:10 12. augusta 2007 03:10
    1 1

    [...] Linux – wysyłanie maila o logowaniu na konto roota Bardzo użyteczny skrypcik [...] [...] Linux - wysyłanie maila o Logowanie na konto roota Bardzo użyteczny skrypcik [...]

Leave a Reply Nechaj Odpoveď

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Môžete použiť tieto značky: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Vyberajte komentáre funkcia bola vypnutá. To receive notification of latest comments posted, subscribe to Ak chcete dostávať oznámenie o najnovšie komentáre posta, prihláste sa My Digital Life Comments RSS feed My Digital Life Komentáre RSS or alebo register to receive register pre príjem new comments in daily email digest. nové komentáre v dennom email Digest.
Custom Search

New Articles Nové články

Incoming Search Terms for the Article Incoming Vyhľadávanie Podmienky pre článok

linux mail change from address linux mail z adresy zmeny - -- linux root email address linux root e-mailovú adresu - -- linux login email notification linux prihlasovacie oznámenia - -- root mail linux root mail linux - -- linux send mail on login linux poslať mail na prihlásenie - -- linux mail change from linux mail zmenu z - -- linux login notification linux prihlásení oznámenia - -- linux mail root linux mail root - -- change root email linux zmeniť root email linux - -- linux email log linux e-mail prihlásiť - -- linux set root email linux set koreňový email - -- linux email alert linux e-mailom - -- linux user login mail alert linux prihlásení užívateľa mailovej oznámenie - -- linux email login linux e-mail prihlásení - -- linux set user email linux užívateľa e-mailom - -- change root email zmeniť root email - -- root email address root e-mailovú adresu - -- mail linux change from mail linux zmenu z - -- email notification when a user logs in linux oznámenia e-mailom, keď sa užívateľ prihlási na linux - -- linux root mail linux root mail - -- linux root user email address linux root e-mailovú adresu - -- linux user login email linux prihlásenie užívateľa email - -- root login notify root prihlásiť oznámiť - -- configure linux to send email alerts konfigurovať linux zaslať e-mailom výstrahy - -- linux alert linux záznamu - -- wordpress blogs wordpress blogy - -- linux remote login notify linux vzdialenej prihlásení oznámiť - -- linux root email linux root email - -- Alert: Root Access from Upozornenie: Root Prístup z - -- set root mail nastaviť root mail - -- linux email on login linux e-mailom na prihlásenie - -- linux get administrator e-mail address linux administrátor dostanete e-mailovú adresu - -- linux send email when user login linux poslať email, keď užívateľ prihlásiť - -- how can I have alert everytime if someone login my server via root user Ako môžem mať záznam vždy keď niekto moje prihlasovacie server cez root - -- how to mail alerts linux ako mailom oznámenie na linux - -- how to get linux mail jak se dostat linux mail - -- linux alert on new login linux záznam o nové prihlasovacie údaje - -- linux linux - -- notify when user logs in ssh linux oznámi, kedy užívateľ prihlási do ssh linux - -- linux mail alerts linux mail výstrahy - -- linux mail an root linux poštou root - -- linux email when user logs in linux e-mail, keď užívateľ prihlasuje - -- linux send root mail linux root poslať mail - -- all všetko - -- linux successful login notification linux úspešnom prihlásení oznámenia - -- linux email root linux root email - -- Receive an email when someone logs in as root Prijať e-mail, keď niekto prihlási ako root - -- email alerts linux e-mailové upozornenia linux - -- linux notify root login linux oznámiť root prihlásení - -- linux send mail login linux poslať mail prihlásení - --