The Archives

Browse the content below to find what you're looking for.

Install a root breach DETECTOR and EMAIL WARNING

Wednesday, June 16th, 2010

If someone eventually does happen to get into your server using the root account, be warned the instantly by  installing a detector and warning message at your server.

Yes, the unidentified person can and will do every unwanted modifications in your server but with this detector installation you will at least get the hackers/spammers IP address/es and be warned someone is in there without your permission.

Let your server send an e-mail every time someone logs in as root

To have the server send e-mail to you everytime someone logs in as root, SSH into your server and login as root.

At command prompt type:
pico .bash_profile

Scroll down to the end of the file and add the following line:

echo ‘ALERT – Root Shell Access on:’ `date` `who` | mail -s “Alert: Root Access from `who | awk ‘{print $6}’`” your@email.com

Save and exit.

Set an SSH Legal Message on your server

To display an SSH legal message to every user who logs in to your server, SSH into the server and login as root.

At command prompt type:
pico /etc/motd

Enter your message, save and exit.

An example would be:
————————————————————————————————————————————————————–

You are entering a secured area! Your IP and login information have been recorded. All activities on this system are recorded and logged. Unauthorized access will be reported and investigated to the appropriate law enforcement agencies.

————————————————————————————————————————————————————–

Find and remove formmail

Wednesday, June 16th, 2010

Form mail is used to send out spam email by relay and injection methods. There are quite a few versions of it and if you are using matts script or version like it, you are in trouble.

So how do I find and if found, remove formmail? Follow these steps:
On you command line, type:
find / -name “[Ff]orm[mM]ai*”

CGIemail is also a security risk:
find / -name “[Cc]giemai*”

Type this command to disable form mails:
chmod a-rwx /path/to/filename
(a-rwx translates to all types, no read, write or execute permissions).

All form mail installation are now disabled.

If a client or someone on your dedicated or virtual server installs form mail, you will have to let them know you are disabling their script.