Jump to content

Make my Server more secure

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
Grub

Grub

    Learning Programmer

  • Members
  • PipPipPip
  • 57 posts
How can I make my server more secure and stop hackers from attempting to hack?

#2
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Ban their IP Address when you discover they are trying to hack.

Here is how:

1. Login to your server via SSH and su - to root (do not forget the - after su).

2. After logging in as root, you may want to look at what's already loaded, if anything. To look at the tables that are currently in effect:

(Note: You might need to add "| less" to the end of your iptables -L commands if you have a lot of iptables rules. This will let you view the rules one page at a time. You can use "q" to quit.)

# iptables -L -n

3. To successfully block an IP address, the syntax would be:

# iptables -I INPUT -s IP_ADDRESS_HERE -j DROP

e.g.:

# iptables -I INPUT -s 123.123.123.123 -j DROP

4. To verify that your entry was successful:
(Note: You might need to add "| less" to the end of your iptables -L commands if you have a lot of iptables rules. This will let you view the rules one page at a time. You can use "q" to quit.)

(as root still)

# /sbin/iptables -L -n

5. If you want to flush your IPtables:

# /sbin/iptables -F

You can find other options to choose from with the following command:

# /sbin/iptables --help

Block From: [Linux] Block IP Address using IPtables - Webmaster Forum

#3
Crop

Crop

    Learning Programmer

  • Members
  • PipPipPip
  • 62 posts
Thank you, that should do the trick. I'm also going to setup a Firewall.

#4
Guest_tcm9669_*

Guest_tcm9669_*
  • Guests
I thought that linux was already more secure, but I see that I'm wrong.

#5
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Well I think if you want it to be 100% secure then just disconnect it from the internet and from any form of network.. perhaps even switch it off :p

Jokes apart.. I too thought that linux was way more than secure, but I too was wrong.. duh.. what a Linux illiterate I am!