How to Get Linux Server Sends Email Alert on Root Login Kā Get Linux Server Sūta e-pasta brīdinājumu par 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. Lai uzlabotu drošību, servera, jo īpaši interneta serveri, kas pakļauj ar internetu, un, iespējams, visā pasaulē hackers, ir labākais, kas ļautu serverim automātiski nosūtīs paziņojumu e-pastu uz iepriekš definētu e-pasta adrese everytime kāds apaļkoku kā root uz uzņēmējvalsti. 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. Lai konfigur automātisku e-pasta brīdinājumu paziņojumu noklusēto e-pasta adresi, uz katra starpgadījuma saknes pieteikties uz servera, izmantojiet šādas guide.

  1. Login to the server via SSH using as root ID. Login to servera, izmantojot SSH izmantojot sakņu ID.
  2. Ensure that you're at home directory of root. Pārliecinieties, ka esat mājās directory saknes. The open up the .bash_profile for editing using pico or vi by typing one of the following commands at command shell line: Ar atvērtu. Bash_profile rediģēt, izmantojot Pico vai vi mašīnrakstā vienu no šiem komandas pie command shell pozīcija:

    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: Ritiniet uz leju līdz beigām, failu un pievienot šādas pozīcija:


    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. Aizstāt user@email.com ar faktisko e-pasta kontu adresi, kuru vēlaties saknes piekļuve trauksmes paziņojums ir nosūtīts uz. Note that you can change the text contains in the email alert too. Ievērojiet, ka varat mainīt teksta satur e-pasta brīdinājumu 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. Tekstu, sākot ar pirmo brīdinājumu ir uzrakstīts, e-pasta ķermeņa, un jums var pievienot citu informāciju, piemēram, uzņēmēja vārds vai mainīt formulējumu. The second Alert is the email title which you can change to your own too. Otro brīdinājumu, ir e-pasta virsrakstā, ko varat mainīt uz jūsu too.

Now logout and login again as root, you should receive an email alert at your inbox. Tagad logout un login atkal, kā root, jums ir jāsaņem e-pasta brīdinājumu jūsu inbox. The security trick should works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD and etc. Drošības triks būtu darbu populārākās aromāts no Linux, piemēram, RedHat, CentOS, Ubuntu, FreeBSD utt

IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: Šī lapa ir mašīna tulkoto un ar nosacījumu ", kas ir" bez garantijas. Machine translation may be difficult to understand. Machine translation var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.


4 Responses to “How to Get Linux Server Sends Email Alert on Root Login” 4 Atbildes uz "Kā Get Linux Server Sūta e-pasta brīdinājumu par Root Ieiet"

  1. dean dekāns
    November 21st, 2008 03:41 Novembris 21, 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? Vai ir tā, ka IP ir persona, kas baļķi, kas parādīsies?

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

    This works for root login or su – from a user login. Šis darbi root login vai su - no lietotāja pieteikumvārdu.
    How can I implement it that will work also for “su” only? Kā es varu īstenot to, ka strādās arī ar "su" tikai? 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. Uz doto brīdi, jo ceļš mainīsies ar su vietā su - tā nebūs, sūtiet e-pastu, ja kāds nav izmantojot "-" pēc tam, kad su. Thanks. Pateicība.

  3. Jon Jon
    May 3rd, 2008 05:43 Maijs 3, 2008 05:43
    2 2

    'who -m' makes the output much cleaner when using this on a system that has multiple users logged on… "kas-m" padara produkcijas daudz tīrāku, izmantojot šo uz sistēmu, kas ir vairākiem lietotājiem pieteicies uz ...

    -m reports only hostname and user associated with stdin terminal -m ziņojumus tikai resursdatora un lietotāju saistītas ar stdin termināls

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

    [...] 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 [...]

Leave a Reply Atstāj atbildi

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> Jūs varat izmantot šos tagus: <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. Parakstīties uz komentāriem iezīme ir atspējota. To receive notification of latest comments posted, subscribe to Lai saņemtu paziņojumu par jaunāko komentāri norīkots darbā, abonēt My Digital Life Comments RSS feed Mani Digital Life Comments RSS feed or vai register to receive reģistrēties, lai saņemtu new comments in daily email digest. jauni komentāri ikdienas e-pasta sagremot.
Custom Search

New Articles Jauns pants

Incoming Search Terms for the Article Incoming Meklēt Noteikumi par pants

linux mail change from address Linux mail pārmaiņas no adresi - -- linux root email address Linux root e-pasta adrese - -- linux login email notification Linux pieteikšanās e-pasta ziņojumu - -- root mail linux root pasts Linux - -- linux send mail on login Linux sūtīt uz login - -- linux mail change from Linux mail pārmaiņas no - -- linux login notification Linux login paziņojums - -- linux mail root Linux mail root - -- change root email linux mainīt root email Linux - -- linux email log Linux email log - -- linux set root email Linux, kas root e-pastu - -- linux email alert LINUX e-pasta brīdinājumu - -- linux user login mail alert Linux lietotājs login pasta brīdinājumu - -- linux email login Linux email login - -- linux set user email Linux mainītu lietotāja e-pastu - -- change root email mainīt root e-pastu - -- root email address root e-pasta adrese - -- mail linux change from pasts Linux pārmaiņas no - -- email notification when a user logs in linux e-pasta paziņojumu, kad lietotājs apaļkokiem ar Linux - -- linux root mail Linux root pasts - -- linux root user email address Linux root lietotāja e-pasta adrese - -- linux user login email Linux lietotājs pieteikšanās e-pastu - -- root login notify root login paziņot - -- configure linux to send email alerts konfigurēt Linux, lai nosūtītu e-pasta brīdinājumus - -- linux alert Linux trauksmes - -- wordpress blogs WordPress blogus - -- linux remote login notify Linux attālās login paziņot - -- linux root email Linux root e-pastu - -- Alert: Root Access from Alert: Root Piekļuve no - -- set root mail noteikt saknes pasts - -- linux email on login LINUX e-pasta login - -- linux get administrator e-mail address Linux iegūt administratora e-pasta adrese - -- linux send email when user login Linux nosūtīt e-pastu, kad lietotājs login - -- how can I have alert everytime if someone login my server via root user Kā es varu būt trauksmes everytime ja kāds login mana servera caur root lietotāja - -- how to mail alerts linux kā pasta brīdinājumus Linux - -- how to get linux mail kā nokļūt Linux pasts - -- linux alert on new login Linux brīdinājums par jaunu pieteikumvārdu - -- linux Linux - -- notify when user logs in ssh linux paziņo, kad lietotājs apaļkokiem ar SSH Linux - -- linux mail alerts Linux pasta brīdinājumus - -- linux mail an root Linux mail par root - -- linux email when user logs in Linux e-pastu, kad lietotājs apaļkoku in - -- linux send root mail Linux sūtīt root pasts - -- all viss - -- linux successful login notification Linux sekmīgas pieteikšanās paziņojumu - -- linux email root Linux email root - -- Receive an email when someone logs in as root Saņemiet e-pastu, kad kāds apaļkoku kā root - -- email alerts linux e-pasta brīdinājumus Linux - -- linux notify root login Linux paziņo root login - -- linux send mail login Linux sūtīt login - --