2

I've installed Hping3 on my Ubuntu 8.04, but after installation when I want to use Hping3 I got this error:

Command 'hping3' is available in '/usr/sbin/hping3'
The command could not be located because '/usr/sbin' is not included in 
the PATH environment variable. 
This is most likely caused by the lack of administrative privileges
associated with your user account.

also when I try to run ifconfig I get this:

Command 'ifconfig' is available in '/sbin/ifconfig'
The command could not be located because '/sbin' is not included in 
the PATH environment variable.
This is most likely caused by the lack of administrative privileges
associated with your user account.

First I need to run sudo su and then run the command. Is this normal? Or am I missing something?

when I run echo $PATH I get:

 /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/amirreza/simulator/ns-allinone-2.33/bin:/home/amirreza/simulator/ns-allinone-2.33/tcl8.4.18/unix:/home/amirreza/simulator/ns-allinone-2.33/tk8.4.18/unix:/home/amirreza/simulator/ns-allinone-2.33/ns-2.33/:/home/amirreza/simulator/ns-allinone-2.33/nam-1.14/
2
  • Come to think of it, is this on a fresh install? Can you think of any reason your $PATH might be messed up?
    – sk29910
    Feb 23, 2011 at 14:05
  • Try adding /sbin and /usr/sbin to your current $PATH, separated by colons just like the rest.
    – sk29910
    Feb 23, 2011 at 15:32

1 Answer 1

3

hping usually needs to be run as root (just like many other network analysis tools).

That said, both /sbin and /usr/sbin should be in your $PATH. Not being able to run ifconfig is definitely not normal and a major annoyance. Here's my $PATH for your reference:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

You can display it using echo $PATH and edit it using export, like this:

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

PS. My root $PATH is

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin

... just in case.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .