Configure SSH Login Email Alerts in RHEL 8 | Receive SSH Login Alerts on Email for Your Linux Server
Configure SSH Alerts in Redhat Enterprise Linux 8:
——————————————————————————–
1. Login in the server as the root user. Ensure that you have already configured the lcoal yum repository.
# yum repolist
if you need help in configuring local repository in RHEL 8, click below link to watch the video for help.
2. Install sendmail & mailx packages from local yum repository in your machine.
# yum install -y mailx sendmail
3. Start the sendmail service and also enable it.
# systemctl start sendmail
# systemctl enable sendmail
4. Now go to home directory of root user & longlist the contents of it including hidden files.
# cd
# ls -al
5. Here you will see a .bashrc profile file, open it in vi editor and paste the line mentioned below there.
# vim .bashrc
echo ‘ ALERT – Root Shell Access 192.168.1.107 on:’ `date` `who` | mail -s ” Alert: Root Access” er.vikasnehra@yahoo.com
Here replace the email address and ip address with your own email address and your machine ip address/hostname.
Better to use yahoo mail because other gmail and other mail services sometimes cause problems.
6. Now SSH into your machine from to test whether you receive the alert email in your inbox or not.
7. Open your mailbox & check in spam folder, you will see the Login Alert Emails there.
In case you want to generate alerts for any other user, just follow the same procedure after going to his home directory & add those lines in his .bashrc profile.
================
Thanks for watching the video. Please like our videos, share with your friends and feel free to ask anything, post your queries in comments section. We will be glad to answer your queries. Don’t forget to subscribe the channel & turn on the bell notifications.
===============
Our Some Popular Videos:
NAVIC:
Learn Linux Fundamentals:
Concept of All RAID Levels:
Configure RAID-0 in Linux:
Configure RAID-1 in Linux:
Configure RAID-5 in Linux:
Configure RAID-6 in Linux:
Configure RAID-10 in Linux:
LVM Snapshot:
====================================================
Contact Us:
To Follow Vikas Nehra’s Twitter Handle:👇
http://bit.ly/VikasNehraTwitterHandle
For Registration:👇
http://bit.ly/NehraClassesRegForm
To Follow Our Twitter Handle:👇
http://bit.ly/NehraClassesTwiiterHandle
To Visit Our Facebook Page:👇
www.facebook.com/nehraclasses
To Follow Nehra Classes on Instagram:👇
https://www.instagram.com/nehraclasses/
To Our Visit Our Webpage:👇
http://bit.ly/NehraClassesWebpage
Join Us on Telegram App: 👇
https://t.me/NehraClasses
WhatsApp Us: 👇
https://bit.ly/2Kpqp5z
Email Us:👇
Email: nehraclasses@gmail.com
============
©COPYRIGHT. ALL RIGHTS RESERVED.
by Nehra Classes
linux smtp server
for it to work do i have to have the smtp mail server installed?
If I want generate email for all the user around 60 have access ssh I can't go each n every user bash.rc .. then what would be the procedure ..