Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> Preventing hacking, How?
Michael Aivaliot...
post Feb 5 2006, 07:00 PM
Post #1

Junior Member

Group: Members
Posts: 15
Joined: 23-April 03
Member No.: 123

Go to the top of the page
+Quote Post
post Feb 5 2006, 07:47 PM
Post #2

Super Member

Group: Members
Posts: 1804
Joined: 10-March 04
From: Cordoba, Argentina
Member No.: 554

maybe it was configured so you can't login to ssh using root user.
the best is to login using a common user and then "su" to the root, if you need it.

there is some common security hardening measures to do on a linux server (no silver bullets):

1. Upgrade Apache/PHP, openssh, openssl, mysql etc.

Nothing new here, but you'll make sure your running the latest secure versions of commons software components. This is the first step in preventing your server getting cracked by common exploits. Usually there are no downsides, but if you have specific version requirements for particular apps, some upgrades should be made with caution.

2. Firewall Installation.

Please be aware this is not a silver bullet, and these do not prevent exploits of services you do run. You will also need to be aware you have a firewall and may need to open up additional ports as needed if you add new services.

3. Rkhunter Installation.

Although not a preventative mechanism, it can be useful to detect any failures in your layers of defense. It's a cron job that scans your system for rootkits, exploits, trojans and backdoors.


No downsides, although there can sometimes be false alarms.

4. Mod_Security Installation.

Mod security is effectively a firewall for web based apps and can help prevent attacks on programs that would otherwise be vulnerable.

This can be fine tuned, but you may limit some "power" user customers (easily rectified).


5. /tmp hardening.

Many attacks and exploits use /tmp to work out of any propogate themselves. By making /tmp a seperate partition and mounting it noexec and nosuid (meaning executables cannot be run from /tmp nor with escalated privileges), this stops many of these exploits from being able to do any harm.

A potential downside is making /tmp too small for some operations like account backups/transfers.

6. Disable non-root access to unsafe binaries.

Many exploits use well known executables already on your system as part of their bag of tools. By only allowing privileged users access to these files, you can cause many attacks to not function.

You may find some binaries like "wget" too useful to limit access to, despite being useful to crackers too.

7. Disable SSH root access.

Root ssh is bad because a brute force attack can use the known username 'root' and concentrate on password variations. By using a unique username (not something like admin) you creatly reduce the chance of a successful brute force attack.

Some people use root ssh in the form of ftps to access the entire filesystem. There are several ways to workaround this, like creating a new user with uid 0 as well. You also need to be aware of this when requesting support, and give to your support team the no-root login info.

8. Change SSH Port.

An additional layer of security is to change the default ssh port to something else. Although this is akin to security by obscurity, it can let you completely avoid many script kiddy atacks.

Like non-root ssh, you need to be aware of this when requesting support, and give to your support team the alternate port info.

9. PHP suEXEC support.

When PHP runs as an Apache Module it executes as the user/group of the webserver which is usually "nobody" or "apache". php suEXEC changes this so scripts are run as a CGI.

This means scripts are executed as the user that created them. If user "snow" uploaded a PHP script, you would see it was "snow" running the script when looking at the running processes on your server. It also provides an additional layer of security where script permissions can't be set to 777 (read/write/execute at user/group/world level).

The downside however is that there can sometimes be issues with any .htaccess directives you have, specifically in regards to PHP directives. You may have to remove PHP directives from .htaccess and move them into a php.ini file inside of your site's document root. In addition, there could be some performance loss (also known as seeing a higher server load) as a result of all php scripts being ran as a seperate CGI instead of as part of the Apache module.

just my 2 cents

Go to the top of the page
+Quote Post
post Apr 8 2006, 07:26 PM
Post #3

Super Moderator

Group: Members
Posts: 420
Joined: 19-December 05
From: Los Angeles, CA
Member No.: 1944

Wow! Tell me this guy isn't amazing.

That's exactly how my server's setup, thanks to Martin.

Before Martin = blink.gif unsure.gif
After Martin = biggrin.gif tongue.gif

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| Mark Mutti [Super Moderator]
| I'm not a HOSTONY Staff Member, but if you need a post moderated or spam
| deleted please let me know.

-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


Lo-Fi Version Time is now: 28th May 2018 - 01:03 AM