Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-11-2015, 05:25 AM   #1
LQ Newbie
Registered: Sep 2015
Location: Dhaka, Bangladesh
Posts: 1

Rep: Reputation: Disabled
Question bash: iptables: command not found CentOS 5.5

[root@104 sbin]# ls
accton                  installkernel                  netplugd
addpart                 ip                             netreport
adsl-connect            ip6tables                      new-kernel-pkg
adsl-setup              ip6tables-restore              nologin
adsl-start              ip6tables-save                 pam_console_apply
adsl-status             ipmaddr                        pam_tally
adsl-stop               iptables                       pam_tally2
agetty                  iptables-restore               pam_timestamp_check
arp                     iptables-save                  parted
arping                  iptunnel                       partprobe
audispd                 iwconfig                       partx
auditctl                iwevent                        pccardctl
auditd                  iwgetid                        pcmcia-check-broken-cis
aureport                iwlist                         pcmcia-socket-startup
ausearch                iwpriv                         pidof
autrace                 iwspy                          pivot_root
badblocks               killall5                       plipconfig
blkid                   klogd                          portmap
blockdev                kpartx                         poweroff
cbq                     kpartx.static                  pppoe
cciss_id                kudzu                          pppoe-relay
change_console          ldconfig                       pppoe-server
chkconfig               logsave                        pppoe-sniff
clock                   losetup                        ppp-watch
consoletype             lsmod                          pvscan
cryptsetup              lspci                          quotacheck
ctrlaltdel              lspcmcia                       quotaoff
debugfs                 lsusb                          quotaon
delpart                 lvm                            rdisc
depmod                  lvm.static                     rdump
dhclient                MAKEDEV                        rdump.static
dhclient-script         mcstransd                      reboot
dhcp6c                  mdadm                          request-key
dm_dso_reg_tool         mdadm.static                   resize2fs
dmeventd                mdassemble.static              restore
dmevent_tool            mdmpd                          restorecon
dmraid                  mgetty                         restore.static
dmraid.static           microcode_ctl                  rmmod
dmsetup                 mii-diag                       rmt
dmsetup.static          mii-tool                       rngd
dosfsck                 mingetty                       route
dosfslabel              mkbootdisk                     rpc.lockd
dump                    mkdosfs                        rpc.statd
dumpe2fs                mke2fs                         rrestore
dump.static             mkfs                           rrestore.static
e2fsck                  mkfs.cramfs                    rtmon
e2image                 mkfs.ext2                      runlevel
e2label                 mkfs.ext3                      runuser
ether-wake              mkfs.msdos                     scsi_id
ethtool                 mkfs.vfat                      service
extlinux                mkinitrd                       setfiles
fdisk                   mkswap                         setkey
findfs                  modinfo                        setpci
firmware_helper         modprobe                       setsysfont
fixfiles                mount.ecryptfs                 sfdisk
fsck                    mount.ecryptfs_private         sgpio
fsck.cramfs             mount.nfs                      shutdown
fsck.ext2               mount.nfs4                     slattach
fsck.ext3               mpath_ctl                      sln
fsck.msdos              mpath_prio_alua                start_udev
fsck.vfat               mpath_prio_alua.static         sulogin
fstab-decode            mpath_prio_emc                 swapoff
fuser                   mpath_prio_emc.static          swapon
generate-modprobe.conf  mpath_prio_hds_modular         sysctl
genhostid               mpath_prio_hds_modular.static  syslogd
getkey                  mpath_prio_hp_sw               tc
grub                    mpath_prio_hp_sw.static        telinit
grubby                  mpath_prio_intel               tune2fs
grub-install            mpath_prio_intel.static        udevcontrol
grub-md5-crypt          mpath_prio_netapp              udevd
grub-terminfo           mpath_prio_netapp.static       udevd.static
halt                    mpath_prio_ontap               udevsettle
hdparm                  mpath_prio_ontap.static        udevtrigger
hwclock                 mpath_prio_rdac                umount.ecryptfs
ifcfg                   mpath_prio_rdac.static         umount.ecryptfs_private
ifconfig                mpath_prio_tpc                 umount.nfs
ifdown                  mpath_prio_tpc.static          umount.nfs4
ifenslave               mpath_prio_weighted            unix_chkpwd
ifrename                mpath_prio_weighted.static     unix_update
ifup                    mpath_wait                     update-pciids
init                    multipath                      vconfig
initlog                 multipathd                     vgchange
insmod                  multipath.static               vgscan
insmod.static           nameif                         weak-modules
install-info            nash                           ypbind
[root@104 sbin]# iptables -L
bash: iptables: command not found
[root@104 sbin]# sudo iptables -L
sudo: iptables: command not found

Tried everything with 'iptables'. The latest version of 'iptables' is at sbin. I'm in 'sbin' directory. But it says "iptables: command not found". What shall I do now?
Old 09-14-2015, 09:11 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,754
Blog Entries: 14

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
Are you running this command as root? Did you login directly as root or switch user (su)? If you did the su did you add the "-" flag so it invokes root's environment on the switch (su -)? As root if you run "echo $PATH" what do you see?
Old 09-14-2015, 01:42 PM   #3
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,039

Rep: Reputation: 2458Reputation: 2458Reputation: 2458Reputation: 2458Reputation: 2458Reputation: 2458Reputation: 2458Reputation: 2458Reputation: 2458Reputation: 2458Reputation: 2458
sbin is LOCKED off from NON ROOT users

that location is EXPLICITLY not included in the non root $PATH

-- security --

if you used the NON ROOT path "su"
then use the correct command
su -l root
----- type in the root password when asked-----
or use the SHORTCUT command
su -
----- type in the root password when asked-----

be warned CentOS 5.5 is missing 6 minor version upgrades
and is 4.5 YEARS!!! out of date
the current in the old legacy support OS is 5.11
and 5.11 is the ONLY suppored version in the legacy series 5 version of Cent

Last edited by John VV; 09-14-2015 at 01:45 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash:openssl:command not found error on generating ssl certificate on postfix centos SarahGurung Linux - Security 7 07-25-2014 07:47 AM
[SOLVED] Centos 5 Error :- -bash: yum: command not found sachinsud Linux - Server 56 06-21-2012 07:41 PM
[SOLVED] "bash: make: command not found" on CentOS 6 TehGoat Linux - Software 3 11-20-2011 03:06 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-27-2006 11:57 PM
iptables command not found ryancw Linux - Newbie 12 10-19-2003 12:38 PM

All times are GMT -5. The time now is 11:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration