How to Get Linux Server Sends Email Alert on Root Login Dapatkan cara Server Linux Mengirim Email Alert pada 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. Untuk meningkatkan keamanan server, khususnya web server yang exposes ke Internet di seluruh dunia dan kemungkinan hacker, maka untuk mengaktifkan server secara otomatis mengirim email pemberitahuan ke alamat email standar seseorang setiap kali log in sebagai root untuk 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. Untuk mengkonfigurasi email otomatis tanda pemberitahuan ke alamat email default pada setiap kejadian akar login di server, gunakan panduan berikut ini.

  1. Login to the server via SSH using as root ID. Login ke server melalui SSH menggunakan ID sebagai root.
  2. Ensure that you're at home directory of root. Pastikan Anda di rumah direktori akar. The open up the .bash_profile for editing using pico or vi by typing one of the following commands at command shell line: Yang terbuka di atas. Bash_profile untuk mengedit menggunakan pico atau vi dengan mengetikkan salah satu perintah berikut di baris perintah shell:

    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: Gulir ke bawah ke bagian akhir file tersebut dan menambahkan baris berikut:


    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. Ganti user@email.com dengan alamat sebenarnya account email yang ingin Anda akses root tanda pemberitahuan sudah dikirim ke. Note that you can change the text contains in the email alert too. Perlu diketahui bahwa Anda dapat mengubah teks dalam email berisi peringatan juga. 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. Teks pertama dimulai dengan ALERT email ditulis sebagai tubuh, dan Anda dapat menambahkan informasi lain seperti nama host atau mengubah wordings. The second Alert is the email title which you can change to your own too. Tanda yang kedua adalah judul email yang dapat mengubah Anda sendiri juga.

Now logout and login again as root, you should receive an email alert at your inbox. Sekarang logout dan login kembali sebagai root, anda akan menerima email peringatan di kotak masuk. The security trick should works on most popular flavor of Linux such as RedHat, CentOS, Ubuntu, FreeBSD and etc. Trik keamanan harus bekerja pada rasa yang paling populer seperti RedHat Linux, CentOS, Ubuntu, FreeBSD dan lain-lain

IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman yang diterjemahkan mesin dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Mesin terjemahan mungkin sulit dimengerti. Please refer to Silakan merujuk ke original English article artikel asli Inggris whenever possible. bila memungkinkan.


4 Responses to “How to Get Linux Server Sends Email Alert on Root Login” 4 Responses to "Bagaimana Mendapatkan Server Linux Mengirim Email Alert pada Root Login"

  1. dean dekan
    November 21st, 2008 03:41 November 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? Apakah ada cara untuk mendapatkan IP dari orang yang muncul dalam log?

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

    This works for root login or su – from a user login. Ini berfungsi untuk login root atau su - dari pengguna login.
    How can I implement it that will work also for “su” only? Bagaimana saya dapat menerapkannya yang juga akan bekerja untuk "su" saja? 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. Sekarang sejak path akan berubah, bukan dengan su su - ia tidak akan mengirim email jika seseorang tidak menggunakan "-" setelah su. Thanks. Terima kasih.

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

    'who -m' makes the output much cleaner when using this on a system that has multiple users logged on… 'yang-m' membuat banyak output bersih ini pada saat menggunakan sistem yang memiliki beberapa pengguna login di ...

    -m reports only hostname and user associated with stdin terminal m-laporan hanya host dan user yang berhubungan dengan terminal stdin

  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 12 Agust 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 Meninggalkan Balas

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> Anda dapat menggunakan tag ini: <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. Berlangganan ke fitur komentar telah dinonaktifkan. To receive notification of latest comments posted, subscribe to Untuk menerima pemberitahuan komentar diposting terbaru, berlangganan My Digital Life Comments RSS feed Saya Digital Life Komentar RSS feed or atau register to receive mendaftar untuk menerima new comments in daily email digest. komentar baru di email harian digest.
Custom Search

New Articles Artikel Baru

Incoming Search Terms for the Article Cari Syarat masuk untuk Artikel

linux mail change from address linux mail dari alamat - -- linux root email address linux root alamat email - -- linux login email notification linux email login pemberitahuan - -- root mail linux mail root linux - -- linux send mail on login linux mengirim surat pada login - -- linux mail change from linux mail dari - -- linux login notification linux login pemberitahuan - -- linux mail root linux root mail - -- change root email linux mengubah email linux root - -- linux email log linux email login - -- linux set root email linux root mengatur email - -- linux email alert linux email peringatan - -- linux user login mail alert linux Login user mail peringatan - -- linux email login linux login email - -- linux set user email linux menetapkan pengguna email - -- change root email mengubah root email - -- root email address akar alamat email - -- mail linux change from mail dari linux - -- email notification when a user logs in linux email pemberitahuan ketika user log in linux - -- linux root mail linux root mail - -- linux root user email address linux root alamat email - -- linux user login email linux pengguna email login - -- root login notify login root memberitahu - -- configure linux to send email alerts mengkonfigurasi linux untuk mengirim email alert - -- linux alert linux waspada - -- wordpress blogs wordpress blog - -- linux remote login notify linux jauh login memberitahu - -- linux root email linux root email - -- Alert: Root Access from Alert: Root Access dari - -- set root mail menetapkan akar mail - -- linux email on login email login pada linux - -- linux get administrator e-mail address linux administrator mendapatkan alamat e-mail - -- linux send email when user login linux mengirim email ketika user login - -- how can I have alert everytime if someone login my server via root user bagaimana saya bisa ada tanda jika seseorang setiap kali saya login melalui server root - -- how to mail alerts linux cara mail alert linux - -- how to get linux mail cara mendapatkan linux mail - -- linux alert on new login linux tanda pada login baru - -- linux linux - -- notify when user logs in ssh linux memberitahu ketika pengguna log ssh di linux - -- linux mail alerts linux mail alert - -- linux mail an root linux root mail yang - -- linux email when user logs in linux email ketika user log in - -- linux send root mail linux root mengirim surat - -- all semua - -- linux successful login notification linux berhasil login pemberitahuan - -- linux email root email linux root - -- Receive an email when someone logs in as root Menerima email ketika seseorang log in sebagai root - -- email alerts linux email alert linux - -- linux notify root login linux root memberitahu login - -- linux send mail login linux mengirim email login - --