Security
One method of increasing security is by shutting down services that are not required.
You can change whether a particular services is running or not by using the chkconfig command.
As super user, you can use the command: chkconfig --list to see what services are currently designed to be started upon bootup, depending on the run level.
To remove a service from starting up at boot, use the following command chkconfig --del <servicename>. An example of a servicename is gpm
To add a service to the starting up list at boot, use the following command chkconfig --add <servicename>. This will add the service to the default init levels
The following lists the current default services I would recommend running:
Using a personal firewall on can also protect your machine from external attacks.
I have a proposed configuration that may help in protecting your machine, but I should add, that it isn't as strict as other might like, but you can simply modify, delete or remove rules if you would like.
The current rules I have listed are:
The following will provide steps on how to setup a firewall with the above rules:
As super user, issue the following command iptables-restore < /path/to/iptables-saved-file
Then issue the command service iptables save, which will save the iptables rules.
Hopefully your firewall will now be up and running and saved.
If you issue the command service iptables status you should get the following output:
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
Chain RH-Firewall-1-INPUT (2 references)
num target prot opt source destination
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:5900:5920
2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 224.0.0.0/4
4 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpts:20000:20020
5 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255
6 ACCEPT esp -- 0.0.0.0/0 0.0.0.0/0
7 ACCEPT ah -- 0.0.0.0/0 0.0.0.0/0
8 ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353
9 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631
10 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:631
11 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
12 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80
13 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:443
14 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:21
15 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
16 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:10002
17 ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 state NEW udp dpt:10003
18 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:10004
19 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:11000
20 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:11100
21 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8000
22 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8002
23 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:8004
24 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
To add a iptable chain rule, you can issue a command similar to iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 6666:7777 -j ACCEPT, which would accept all traffic using any port within the port range of 6666 - 7777.
To remove a iptable chain rule, you can issue a command similar to iptables -D RH-Firewall-1-INPUT 5, which would delete the rule number 5 from the rule base. Which in the above case, would prevent icmp traffic, which would not allows pings.
| Attachment | Size |
|---|---|
| iptables-saved-file.txt | 1.96 KB |