admin Site Admin
Joined: 23 Jan 2003 Posts: 256 Location: India
|
Posted: Thu Aug 04, 2005 7:22 am Post subject: E-mail Alert on Root SSH Login |
|
|
You can get notification email when some one login to your server as root when you are using bash shell.
To enable root login notification, do the following
1. cd /root
2. edit .bashrc file with command
vi .bashrc
3. Add following content to .bashrc file
echo 'ALERT - ServerName Root Access on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" you@yourdomain.com
Change
ServerName to your server name.
you@yourdomain.com to your email address.
4. Save and Exit vi text editor with command :wq
Now log out of SSH and login, you will get SSH Root Login alert email with IP addrss and time of login. _________________ HostOnNet.com - Reseller Hosting
Free Ads Forum, Promote your site
NetFreeHost.com - Free Web Hosting, phpBB Hosting |
|