• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 994
  • Last Modified:

CentOS Godaddy VDS Firewall setup

I recently purchased a godaddy Virtual Dedicated Server with CentOS. I need to get the firewall up and running. does anyone have any sudgestions?
iptables is installed
%service iptables start
bash: service: command not found

any ideas?
0
nole_jesse11
Asked:
nole_jesse11
  • 6
  • 4
1 Solution
 
Kerem ERSOYPresidentCommented:
just run
id
it seems that you are not root..
0
 
nole_jesse11Author Commented:
i was root. i just had to find the iptable binary and reference it directly. i got now, thanks!
0
 
nole_jesse11Author Commented:
merry christmas!
0
Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

 
Kerem ERSOYPresidentCommented:
oh :) I'd thought is was an error abour service not found but as you told service script has an error since it did not find the error.

Thanks for the stocking stuffer :)
0
 
Kerem ERSOYPresidentCommented:
But there's something fishy here. Because "service iptables start" will start iptbales if it can not the iptables script will display an error before script stops with error.

If iptables exits with such an error it seems that there is a problem. It means that it will not start automatically during system start.

Normally iptables must be in /sbin/iptablaes. Will you check if it is located there ?
If it is there there must be problem with the service.

chkconfig --list iptables

must display something like this
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off

But instead if it says that there's a service but it is not included among services then yuou need to register it first.
0
 
nole_jesse11Author Commented:
The service is running. i know because i have been effectively blocking off ports.
chkconfig does not work either. i think the bash shell is missing a path or two. I can go in to rc.d and use the start up script to control it.
0
 
Kerem ERSOYPresidentCommented:
I understand that it works now but. Do you have a custom script for iptbales ?  Because default sstem config is in /etc/sysyconfig/iptables and the script which interprets the config is in /etc/init.d/iptables. I dont think it is possible to run thme without service script (in fact it is possible but you should do it manually)

Both service and chkconfig are normally in /sbin. This path is only included in root user. This is why I had thought you were not root in the beginning.
0
 
nole_jesse11Author Commented:
i went into /sbin and i could use
./chkconfig --list iptables

it matched
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
do you think anything else is wrong?
0
 
Kerem ERSOYPresidentCommented:
it seems that somehow /sbin is not in your path.
display path with:
echo $PATH
checik if /sbin is there.

If not edit /etc/profile for:

# Path manipulation
if [ `id -u` = 0 ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
        pathmunge /scripts
fi

0
 
Kerem ERSOYPresidentCommented:
I think I've found the killer. It is the butler as usual :)

Did you chance your .bash_profile? If you've added something you need to include the former path too such as:

path .:$PATH

this will add . bedore the existing path. But if you don't include it then it will be only . ans wiil tun only some executable in the current directory. Could it be the case ?
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now